Making small readonly objects for webservices

Posts   
 
    
jacob
User
Posts: 32
Joined: 20-May-2005
# Posted on: 11-Jun-2006 21:55:19   

Hello

Im looking for the best way to make small data objects that I can return through a webservice.

The objects will be needed for presentation and there is no use for features like: - Which prefetch/relations possibilites there is for a entity. - If a field has changed since loaded. - Information needed to update database again.

Essentially I would like for the objects only to contain entityfield values and prefetched collections, nothing else.

In our scenario the objects returned will be used for websites and flash. We want the data needed to be transfered to be as small as possibly and the objects to be as clean as possibly.

One way to do it would be to make these smaller classes by hand and some convert functions. But with 40+ tables in our project we would like to find a better way, or maybe doing some templating with methods which convert the normal entity classes to these smaller classes.

We are currently using Selfservicing. But don't mind if solutions is for adapter only.

Has this already been done before?

Any suggestions will be appreciated.

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 11-Jun-2006 23:06:47   

Hi

One way of doing this perhaps would be to create TypeLists using designer. These could be as 'small' or 'big' as you want. wink

jacob
User
Posts: 32
Joined: 20-May-2005
# Posted on: 12-Jun-2006 13:55:06   

TypeLists don't support entity->collection relations. So I wont be able to do Order.Customer; And I get a DataTable instead of objects.

How about the new projection framework. Will I be able to do the following.

Load a collection with prefetches. Make some custom classes. Do a projection incl. relatet entities.

In the documentation there is only entity fields.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 12-Jun-2006 15:11:25   

jacob wrote:

TypeLists don't support entity->collection relations. So I wont be able to do Order.Customer; And I get a DataTable instead of objects.

How about the new projection framework. Will I be able to do the following.

Load a collection with prefetches. Make some custom classes. Do a projection incl. relatet entities.

Not of related entities, you need extra projections for that, or write your own projection engine by implementing the interface. This isn't added as DTO's often don't contain references to related objects, just data.

Frans Bouma | Lead developer LLBLGen Pro