Selfservicing + Compact25 xml. Is there a way?

Posts   
 
    
RichG
User
Posts: 1
Joined: 10-Nov-2010
# Posted on: 10-Nov-2010 08:34:00   

Hi there,

I've been working on a project that was set up by someone else a couple of years ago and now have a need to serialize/deserialize entities to xml. The problem is that the project has been set up as selfservicing and would be a nightmare to change to adapter this late (the project is nearly finished).

The xml is not to be used for instantiating into llblgen entities outside of our system. It is essentially to allow some 3rd party applications to make basic modifications to the xml, which we would then import. The only format that is simple enough and acceptable to the people making the 3rd party application is your Compact25 format.

Is there anyway I can configure (or hack!) LLBLGen to give me Compact25 xml using selfservicing?

Regards,

Rich

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Nov-2010 09:54:27   
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Nov-2010 14:07:21   

It will require you coding it into the runtime, and although it's of course doable, it's not recommended.

Couple of options: - create some templates which generate simple DTO classes, which you serialize to XML using the .net xml serialization classes. This will give simple XML. The only thing you then have to do is to convert an entity instance into a DTO instance of the equivalent type (e.g. customer to CustomerDTO instance), which can be done in a generic method. There are several DTO templates available on this forum, please search for DTO template. As the 3rd party tool likely will communicate with your app through a service, this will allow you to distribute the dto's through the service. - create an adapter project in a different namespace for the entities you want to communicate with the 3rd party tool. To me it seems that the 3rd party tool will simply alter values in an existing entity, and also not all entities, am I correct? so it's doable for '3rd party connectivity' to use a service using adapter entities on the same DB. You can automate generating this code with the command line code generator app we ship with llblgen pro: use a different namespace for the adapter assembly. If you use a smaller set of entities, then of course you need to have two projects.

Frans Bouma | Lead developer LLBLGen Pro