Collections, TypedViews and Dynamic Lists in WCF

Posts   
 
    
Posts: 6
Joined: 02-Oct-2007
# Posted on: 29-Oct-2007 19:17:08   

Hello Everyone, I need some suggestions on how to design a WCF-based system; this is my architecture so far.....

  • IIS Hosted service layer which hosts all my services (I use http binding, but I am open to changing it to a console host with tcp binding)
  • I have two apps that access these services - asp.net web app and a winforms app
  • I am using DTOs only in the user apps..... DTOs are passed/retrieved to/from the service layer which does the db operations using a dataaccessadapter

I am wondering how to deal with collections at this time. I have many grids in my user applications that need to bind to data returned from either collections, dynamic lists, or typedviews.

  1. Is it a good idea to create a DTOCollection template for each entity which can be populated from collections (then how to handle typedviews or dynamic lists)
  2. Is directly returning a collection, typedview or dynamic list as a DataTable or IList a good idea for performance?
  3. How would I do paging and sorting in grids (I know I cant bind to a LLBL DataSourceControl anymore because of the service layer, is there any other elegant method) ?

Thanks for your help Kiran

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 30-Oct-2007 12:48:21   
  1. Is it a good idea to create a DTOCollection template for each entity which can be populated from collections (then how to handle typedviews or dynamic lists)

You can use generic collections or arrays List<DTO entity>. TypedViews, TypedLists and DynamicLists are all dataTables, I think it would be better to pass these over the wire.

  1. Is directly returning a collection, typedview or dynamic list as a DataTable or IList a good idea for performance?

I think so, and don't forget TypedViews, TypedLists and DynamicLists are all dataTables.

  1. How would I do paging and sorting in grids (I know I cant bind to a LLBL DataSourceControl anymore because of the service layer, is there any other elegant method) ?

I think you can still bind to LLBLGenProDataSource, but you'll have to use it manually by setting LivePersistence to false and handle the appropriate events to call the corresponding server methods.

Posts: 6
Joined: 02-Oct-2007
# Posted on: 30-Oct-2007 22:42:09   

Thanks walaa.

I will be using DataTables, although I now have to change a lot of code to return DataTables, I have a feeling its the best option to guarantee performance.

I havent had a chance to try out the LlblDataSouceControl as yet; but I wish I had the source code for that control. I would definitely like to see how it really works and also enhance it to use my own framework.

-Kiran

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 31-Oct-2007 09:42:54   

The source code is installed with the application (not the demo one). Which might look like: C:\Program Files\Solutions Design\LLBLGen Pro v2.5\RuntimeLibraries\Sourcecode

Posts: 6
Joined: 02-Oct-2007
# Posted on: 31-Oct-2007 10:35:51   

Didn't notice before, thanks......i will look into this.