Hello!

Hello!

TMS Aurelius looks really good.
Here's the thing: say you have a new project. Instead of fiddling with the database, you simply:

1) Create the classes
2) Mark the details you may need to customise (such as the table
name) in the class
3) Use the Automapping attribute for the rest.

It is THAT simple.

A

Comments

  1. (; for "hello world", yes, you're winning time, for slightly more advanced operations => commencing hair pull, please stand by

    ReplyDelete
  2. Well, the main issue I am finding is that the documentation seems either incomplete or outright "lying" compared to the examples. W/r existing projects, yeah, I don't think you can avoid the DataModeler because otherwise it's an unending stream of pain. The other thing I find a bit jarring is that there's no "login" example, which I'd guess has to be pretty common. But all in all, it seems it can do lots of stuff. If nothing else, it removes the pain of having to deal with the database to a great degree, and that's a big win in my book.

    ReplyDelete
  3. unclear as to where the pain is when dealing with a database? defining a table is like defining a record or struct, then you have operations which are quite straightforward, then, of course, you can do quite advanced stuff, IMO 5-10% knowledge would cover pretty much any simple proof of concept up to slightly more advanced.

    I hope that Aurelius is properly building the SQL and uses parameters, you wouldn't one someone to do SQL injection from the login screen.

    ReplyDelete
  4. Dorin Duminica I would be very surprised if they were not... it's TMS after all, I think they earned a bit of credit :)
    As for the rest, there are so many menial tasks that need to be done to retrieve things from a database or inserting data into it. It's 2016, there has to be a better way. Obviously, yeah, you could write more ad-hoc queries and do all sort of tricks. And that may be necessary every once in a while for specific things, but one thing is having to go down the rabbit hole with a good reason and another is just "because I have always done so".

    ReplyDelete
  5. Dorin Duminica I suppose you are talking about ORM vs Non-ORM database applications, not Aurelius specifically?

    ReplyDelete
  6. Andrea Raimondi, what do you miss from the documentation and do you mean by "lying"? We always welcome any feedback, even though we consider Aurelius documentation pretty straight to the point and with good cover of all features?

    ReplyDelete
  7. Wagner Landgraf, take for example the topic of queries: if you try to do it as the help says, you'll find it's not possible :)
    For a start, the example  in the docs does not use TLinq (which the example code does) and you do not explicitly say to ensure that Generics.Collections is in the uses to use the generic version of TCriteria. Also, I could not find (yet) where TExpression is :)

    Also, the autobinding attribute docs does not say that you can tune what you need, so people will just think it's an either/or.

    I think there are a few such cases, but I can't find them all.

    ReplyDelete
  8. We have found Aurelius to be a really effective tool but it has taken some time to get to know it.  For me it's been a little like learning a new language all together.  Thinking objects instead of SQL is a very different approach but using an ORM does force a more modern approach and you end up with an application that is much more maintainable and easier to extend.  For example I never really got the hang of unit testing until I started using Aurelius.  Aurelius makes separating out and decoupling your code much simpler.  Also their complimentary products such as Xdata and Flexcell open up a world of possibilities.  So my advice is to stick with it if you can because you will be well pleased in the end if you do :)

    Of course its not perfect, I for one would like it if we were able to use interfaces for our entities and Spring Collections rather than the EMB standard generic TList.  The Aurelius dataset is fantastic for data binding but it does sort of remove you from working directly with your entities.  But when I have got stuck the support from TMS has been fantastic.  Before we used Aurelius we used FIBPlus for data access and it was impossible to get any help if you couldn't figure something out. So all in all we are very satisfied customers.

    ReplyDelete
  9. Steve Sinclair, correct me if I am wrong, but it seems to me that Aurelius, in a sense, works backwards for some things. Example: starting from the DB, you'd have a user with a collection of projects. Using Aurelius, instead, you'll find that it's a lot easier to have a project with a list of project users and then use the user to find the projects that contain it.
    Would you say that this is in fact correct?

    A

    ReplyDelete
  10. Andrea Raimondi Don't quite get what you mean.  When you say a user with a collection of projects, do you mean the database user to connect to log into the database.  And do you mean by projects the rights that user has to tables set.?

    ReplyDelete
  11. Nope, we are talking model here :)

    So say you have something like this:

    Type

      TUser = class
      end;

    Now, when you go from the DB, you'd have a collection of projects for a user. However, using Aurelius it seems to me that having projects to be a separate entity and then associating it to a user to be more logical.

    ReplyDelete
  12. The relationships between objects just mirror what a database does with foreign keys.  So if you have a one to many relationship between two tables "Users" and "Projects" you have one of three ways of setting this up. 1) Simplest way is to use [automapping] and have a TList of projects as a property in the users table. 2) Don't use auto mapping and setup the associations as per the manual. or 3) Start with your database and get the Data Modular application to model reverse engineer your database then export it to Delphi from inside the application and you will get a new unit with all the mapping done for you.

    So really you can start with the database or the entity objects.  It's up to you, if you already have an existing database it's going to be best to start with the Data Modular application.  If you are starting off with a clean sheet my personal preference is to start with the objects and keep building and destroying the database from Aurelius until you have what you want.  One thing that muddies the waters a bit fields that can be null.  In my view, if you are starting a new project it makes it much cleaner to avoid them but if you have an existing database then you will likely have to use them (but the Data Modular will work that out for you).

    Have a look at the music database demo, I found it really helpful when I was starting out

    ReplyDelete
  13. In addition to what Steve said, not sure if that's what Andrea was commenting to, but you can have associations in two directions, or both directions.

    a) User have multiple projects

    TUser = class
      Projects: TList;
    end;

    b) A project has reference to its user:

    TProject = class
      User: TUser;
    end;

    c) Both

    Note that all of those options represent the exact same database structure.

    ReplyDelete
  14. I'm a very satisfied TMS Aurelius user and I can confirm that Wagner has helped me many times, with a lot of patience (as I am especially new both to ORM technology and Aurelius).
    I've tried some other Delphi ORM before Aurelius and (in my opinion and experience) it wins for working out of the box,.
    As for the examples please look the online manual at the following url http://www.tmssoftware.biz/business/aurelius/doc/web/index.html?onlineresources.htm
    Wagner first pointed me to this url and definitely I downloaded and thoroughly studied all the examples in it: I learned a lot of stuff. There is an especial interesting example which teach you how to setup and use a Repository factory: very well done.
    Last thing to note is that Aurelius has worked since I installed it with Firebird + AnyDAC, something I've struggled with some of the ORMs tried before.
    The TMS Aurelius forums is also a great place to ask for help (and receive it) or ask for wishes and, if they are "human useful and reasonable" get realized too :-)

    ReplyDelete
  15. ... and if you should suffer bad performance once a day using Aurelius - check if you can make use of explicit transaction management ...

    https://www.cybertribe.de/druid/de/node/90
    ( German text - but should be translatable )

    ReplyDelete
  16. Steve Sinclair If you want to work with the Spring Collections, then why not take a look at the Spring ORM? :)

    ReplyDelete
  17. at my company we use aurelius and Xdata and we are delighted with the performance and with the support of tms, congratulations to Wagner and his team

    ReplyDelete

Post a Comment