[Lazarus] [ANN] Xavier for XML — Compatible with FPC and Delphi

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Sun Sep 24 10:02:24 CEST 2017

On 2017-09-23 12:36, Michael Van Canneyt wrote:
> That's actually a step backwards.
> Because it breaks the separation of object and storage.

Of course I would normally agree with that, but if you look at the Java 
annotations in that article - they are not code per-se, but more like 
small code comments - enough to tell the JPA backend what to do. And 
Java's RTTI is chock full of information, so the JPA backend can extract 
exactly what it needs.

public class Person {

That's enough to notify the JPA that the Person class can be persisted 
to a "Person" table.

They also work on the concept that defaults are used. You only add 
annotations if the defaults should not be used. This again minimise 
developer effort tremendously.

> Good for some quick and dirty prototyping, but a potential disaster in the long run.

No more effort that maintaining an external XML mapping file, or 
hard-coded CRUD visitor.

> It suffices that the DBA decides to move (part of) the data for storage, and
> you're dead...

That would break all code I can think of, and would require developer 
effort to resolve no matter what.

Sorry, this is getting a bit off-topic in this mailing list, so I'll 
stop here.


fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

My public PGP key:  http://tinyurl.com/graeme-pgp

More information about the Lazarus mailing list