EntityObjects vs DTO's wrt performance while serializing/deserializing

Posts   
 
    
vairam2008
User
Posts: 86
Joined: 11-Mar-2008
# Posted on: 30-Mar-2008 00:56:43   

I was reading this thread to make a decision on where to crystalize on my design. One of the things I noticed while working with my generated code( we have about 300 tables, 20 views ) was that it took a long time to create Unit Test Projects on the generated code. One of the things I like to achieve is creating test scripts for the properties & methods (business rules) of the entities & not the helper methods like getallrelations().... I was looking on how to make the entities to use interfaces. Or provide me a better method to do UnitTesting of my object for the purpose of testing & isolating error scenarios involving with database, webservice, llblgen, binding dependencies.

Also, when I would be adding my business logic code in the business component layer(business components) & when I would put in business entities layer(partial classes of the entities )? seems like common computed properties & business rules in the entities. business validation logic in the business components.

It seems like the approach of validators could solve most of this problem of where to put the validation code. Are the validator objects reusable in the UI for validation as suggested in the other thread that validation happens twice (both business & UI). If else, I would like to type define validators (that it will accept only this type of entity for validation with that validator & vice versa). Is this available default in the generated code or should i customize the templates.

Also do i have to create DTO objects in the scenario of a smart client application communicating with a webservice (working as the data transfer mechanism) for faster data transfer performance or is the compact serializer will help.

thanks

the thread referred: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=920&HighLight=1

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 31-Mar-2008 11:37:56   

It seems like the approach of validators could solve most of this problem of where to put the validation code. Are the validator objects reusable in the UI for validation as suggested in the other thread that validation happens twice (both business & UI). If else, I would like to type define validators (that it will accept only this type of entity for validation with that validator & vice versa). Is this available default in the generated code or should i customize the templates.

Indeed validators is a good solution here, and they can be consumed from the UI, please check the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=12938 Also Validator classes can target single or defined types of entities. So you can have more than one validator class each targeting one or more entities. Using one or more of those DependencyInjectionInfo attributes. Please check the manual's section: Using the generated code -> Setting up and using Dependency Injection

Also do i have to create DTO objects in the scenario of a smart client application communicating with a webservice (working as the data transfer mechanism) for faster data transfer performance or is the compact serializer will help.

DTO's might be lighter to use when serializing and deserializing, and hence better in performance. As you decide which properties to transfer minimizing the footprint.