[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1999
  • Last Modified:

3-tier architecture question: datasets or business objects between tiers?

Hello!

In 3-tier architecture, what is best to send between the tiers, XML, Datasets or custom objects and why?

The book "Expert C# Business Objects" advocates objects.
http://www.amazon.com/gp/product/1590596323/qid=1143544531/sr=1-3/ref=sr_1_3/002-9189888-0974421?s=books&v=glance&n=283155

Which other books should I read to get a good overview of my options?
Are there any particular problems with passing business objects, is there a backside that the author don't mention?
I've got the impression that typed dataset is a rather common choice on what to pass between the tiers?
0
rj2
Asked:
rj2
5 Solutions
 
MilanKMCommented:
I think this varies in many ways. Still see what microsoft says regarding this issue:~

Recommendations for Data Access Strategies:~  
----------------------------------------------------
http://msdn2.microsoft.com/en-US/library/8fxztkff(VS.80).aspx

Thanks
MilanKM
0
 
rj2Author Commented:
Will using business objects result in having to write more code than if using datasets?
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
MilanKMCommented:
See following, exactly what you're looking for..

Designing Data Tier Components and Passing Data Through Tiers:~
---------------------------------------------------------------------------
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/BOAGag.asp

Thanks
MilanKM
0
 
fridomCommented:
This is a quite interesting question. Unfotunatly I have not real good answer nor even a suggestion. I guess for most OO languages the answer is clear the use Objects.

But one problem with objects is: They have to be constructed and in the end they get transformed to something not very objectish e.g as a row in a table.

If you look into popular things like Ruby on Rails, JSP and the like you'll see that a lot of time is spend on

getting textual input -> construct the object -> work on the object
-> flatten the object to put them into an database.

We face a problem OO is quite poor on. Data persistence, agreed there do exsit thousand of solutions for that, but it shows that there is not "common" way. Agree also there do exist OODBs but they are not in wide-spread use.

I once though why should one use anything else but objects today I'm more thinking what the hell do I have from OO?

I think you should read Philip and Alex's Guid to Web publishing to get the point.

I feel with the Web this things even get worse (every day). I'd argue even today most of the information is still text, words one after the other. All in the Web is more or less based on "strings" So for simplicity I 'd argue the best bet is to use something which can do the most crazy things on strings with the least effort.

On the othe hand one other data-structure is ubiqueous, tables, maybe it's really time to get back or progress to somthin which can handle in easiest ways. persistence would nearly a no-op because writing tables in any form is one of the easiest tasks.

Regards
Friedrich
0
 
AGBrownCommented:
Well, you've effectively just asked the BIG QUESTION on how to model your domain layer, and identified the two alternate approaches.

The design-god himself, Martin Fowler, says (I hope I get this right) that it doesn't matter so much which one you use - your decision is probably best made by the tools you have. .NET makes datasets very easily available, so for RAD, that may be the best choice.

I would recommend his book Patterns of Enterprise Application Architecture, it goes into it with a nice balance for each model.

Andy
0
 
AGBrownCommented:
Oh, by the way, don't concentrate too much on "X or Y or XML" - Xml should be regarded, in this case, as a persistence medium for serializing and transporting objects that can then be deserialized at the other end back into in-memory objects. As such the alternatives are binary data, XML etc. Your main choice then comes back to custom Business Objects, or Datasets.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now