Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Design For This
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01390847
Message ID:
01392172
Vues:
65
>Business objects are okay if a design time you know the structure of your data tables and they are not going to change and you bring back teh same structure every time nor be too complex. If you build your queries at runtime and change you number of joins, selected columns, filters etc.. or using updatable views you are better off using datasets.

I disagree. The beauty of business objects is that if you change your backend, your queries don't need to change because they reference the friendly property name, not the backend column name. Business objects allow for complex relationships and adding behavior to the data. And what about an SOA scenario? Do you want to write another layer to convert your datasets into generic lists for use in other non-.net clients? Serializing a dataset for web services becomes a huge object. Business objects are much cleaner and better separated for multi-tier development.

The con is the learning curve and development cost up-front. Writing an app using datasets is quick. I tend to lean towards datasets for smaller, get-out-the-door apps that you don't expect a lot of long-term maintenance on and business objects for the more robust long-term supported enterprise apps.

For dynamic queries, something similar to this:

http://www.15seconds.com/issue/010629.htm

The difference is I am using C# and winforms, and the addcriteria is populated with friendly business object names, not column names and the actual query is generated in another layer (after going through a mapper class that links the friendly business name with the column name).

I just found by searching that there are lots of examples addsearchcriteria, addcriteria, etc... out there. I think the hibernate criteria api may be similar too.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform