Jump to content
Attila Kovacs

RTTI in dpr / console app dpr

Recommended Posts

On 6/13/2020 at 10:17 AM, David Heffernan said:

My post above demonstrates that RTTI does exist. I think that the real issue is that these types don't have qualified names.

Basically this then?

Share this post


Link to post

Treat console apps like you treat VCL or FMX apps.  Keep the actual code in units and have just the skeleton init and run code in the .dpr. 

  • Like 1

Share this post


Link to post

That's what I would do as well. Though it is nice to have everything in one unit...it is not nice to do so, because that code is not reusable, especially if it is in a dpr. And you never know, if you'll need it later on.

  • Like 1

Share this post


Link to post
5 hours ago, Lars Fosdal said:

Treat console apps like you treat VCL or FMX apps.  Keep the actual code in units and have just the skeleton init and run code in the .dpr. 

This is exactly what I started to do lately. All my applications business logics are basically a TObject-descendant, and service initializations or console launchers only create an instance of them.

I find this structure really easy to test, to port, to maintain or extend. This might be my own personal preference, though.

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×