Utilities for converting collections to other data structures

Posts   
 
    
lbialic2
User
Posts: 3
Joined: 13-Mar-2006
# Posted on: 21-Mar-2006 15:56:21   

I'm having a hard time figuring out how to make LLBGen fit into my architecture. I've seen the Archecture posts, but haven't found exactly the answers I'm looking for. I'm using a pretty simple architecture which so many others appear to be using. My system is PL->BL->DL where PL communitates with BL through a webservice. However, in my world, PL can be implemented in .NEt, Java, Perl or whatever. So, the need that I seem to have that I'm not seeing answers for is how to tranfser data from entitycollections in a more generic form.

In other words, my question is - how do I get the heirarchical data from a complex entity collection (that has other entity collection within it) into a more generic XML format? In particular I would like to convert collection -> XMLDataDocument. I believe the XMLDataDocument fits this need of being generic enough for non .NET clients to consume. I would like to be able to convert collection to dataset as well for other purposes.

Has anyone done this?

Thank you in advance for any help.

-leah

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Mar-2006 16:03:05   

Did you try the WriteXml method that's found in the generated Entities classes?

lbialic2
User
Posts: 3
Joined: 13-Mar-2006
# Posted on: 21-Mar-2006 19:47:49   

I can't seem to get this to do what I want. Here is a code snippet. What is WriteXML looking for. I just don't get it. My brain is fried.

          RegNumbersEntity regNumbersEntity = new RegNumbersEntity(inputID)
        IDataAccessAdapter adapter = DataAccessAdapterFactory.GetDataAdapter(appName);

         adapter.FetchEntity(regNumbersEntity);


        string myString = "";
        try
        {
            regNumbersEntity.WriteXml(myString);
        }

        catch (System.Exception ex)
        {

        }
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 22-Mar-2006 19:15:35   

Could you elaborate a bit why WriteXml() doesn't work for you?

Frans Bouma | Lead developer LLBLGen Pro
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 23-Mar-2006 20:11:24   

lbialic2 wrote:

I'm having a hard time figuring out how to make LLBGen fit into my architecture. I've seen the Archecture posts, but haven't found exactly the answers I'm looking for. I'm using a pretty simple architecture which so many others appear to be using. My system is PL->BL->DL where PL communitates with BL through a webservice. However, in my world, PL can be implemented in .NEt, Java, Perl or whatever. So, the need that I seem to have that I'm not seeing answers for is how to tranfser data from entitycollections in a more generic form.

In other words, my question is - how do I get the heirarchical data from a complex entity collection (that has other entity collection within it) into a more generic XML format? In particular I would like to convert collection -> XMLDataDocument. I believe the XMLDataDocument fits this need of being generic enough for non .NET clients to consume. I would like to be able to convert collection to dataset as well for other purposes.

Has anyone done this?

Thank you in advance for any help.

-leah

The best way to look at your architecture is to treat the webservices you want to build as your PL. Then, whatever app wants to consume your webservice does NOT care how or wehere this webservice is getting its data. The keypoint here is to make your BL webservice friendly and preferably UI agonostic (examples of such BL architectures are CSLA and JCL). * Build your DAL (adapter model) * Build your BL (house BL logic, security and data access). BL project references both DAL assemblies. * Build your webservice as a normal webservice project in VS. This WebService project would reference your BL and the generic DAL assemblies). This way you'll have a natrula flow for the devolopment cycle and a perfect abstarction between the tiers.