Starting a new DB project

This topic is discussed in the Aurelius manual, but it's not very satisfying in the end.

So Wagner, when you're starting a new project that requires a brand new DB, do YOU have a preference to either:

(1) start by defining classes, then using Aurelius to generate the DB; or

(2) start by using something like DB Data Modeler to define the tables and then create them in the DB first?

The only edge I can find is that it seems easier (when working in the IDE or a text editor) to duplicate the text for a lot of fields of the same type by copying one and pasting it a bunch of times before changing the name on each line -- as opposed to having to go through some UI where you need to specify the name, type, and maybe length on each one explicitly.

What about attributes needed in the classes? They can't all be told to the DB Data Modeler, right? (Some are implicit) Or can they? If not, then it might be easier to type them out with the rest of the class definition first, right?

David, in my own projects, I always start from the classes. That's personal preference of course, I believe that's what you wanted to know. I find it much easier, faster and better.

Yes, I can copy and paste, write pure code, instead of using visual tools (which I personally don't like much to use). It's easier to version control. I don't have to care about dealing with database field types, foreign keys. Aurelius Automapping mechanism is very handy so I always start with it, don't even need about adding attributes.

In summary, I just code as no DB exist: just create a Delphi class in code and start the adventure.

2 Likes