N-tier layer separations and connection/interaction

I happen to be experimenting based on some examples I've found on the net
but I want to be directed to the right path, those samples tend to be incomplete or misleading. In a typical N-tier scenario, which should reference which And is the use of Data Transfer Object in accordance to any best practice that maybe existing

Accordingly, how does those layers supposed to connect/interact with one another eg. what does BLL passes to the DAL and what is returned to it...



Answer this question

N-tier layer separations and connection/interaction

  • rkorneev

    In it, I state that XML is best because it is more generic and makes it easier to change out different components.

    When you are suggesting passing XML through tiers I assume you are referring to phsyically seperated, not logically seperated tiers

    Greg


  • VandB

    I've got the ff. assemblies:

    1. UI = References BLL and DTO
    2. BLL = References DAL and DTO
    3. DAL = References DTO
    4. DTO (Business Objects)

    I haven't got any real experience on tiers so I wish to know your expert opinions if what I am doing is right or wrong.

    And I'm thinking, since the BLL already references DTO is it possible that the UI won't reference it anymore since it is already referencing BLL Could I instantiate DTO's based on reference to the BLL alone

    @Tim

    Could you provide me links for DTO exponents


  • Compugab

    I've attached the solution I'm currently working on in this thread and I hope you could take some time to fiddle with it and provide me feedbacks on things I maybe doing wrong, things I've got to improve, etc...

    Thanks in advance!


  • sharpdotnet2005

    Dee as a suggestion check out these two books which discuss in detail varying methodologies though both focus on the domain layer

    The first is a classic work by Eric Evans "Domain Driven Design" http://www.amazon.com/exec/obidos/tg/detail/-/0321125215/qid=1143871972/sr=1-1/ref=sr_1_1/102-3319163-1611303 v=glance&s=books

    The second is by a lurker of this forum and a MS architecture MVP Jimmy Nilsson http://www.amazon.com/exec/obidos/tg/detail/-/0321268202/qid=1143871972/sr=1-2/ref=sr_1_2/102-3319163-1611303 v=glance&s=books which will be released shortly.

    The second book discusses in high levels of detail the implementation of a domain layer in C# using an OR mapper.

    Also I will be giving a presentation on this April 22nd in the southern US, where are you located


  • Ashi

    What they pass and return depends on what your needs are. It could be a .Net DataSet, ADO RecordSet, XML, or some custom object. I'm currently working on a conference presentation that will discuss middle tier best practices. In it, I state that XML is best because it is more generic and makes it easier to change out different components.

  • ultrabit79

    I don't have a link specifically for someone who preaches DTOs. Most of the time people who use them don't even realize the pattern they are using. The two main ways I see them being implemented is either as DataSets or using an O/R mapping package. Using O/R mapping products also pushes you in a specific direction with your DAL. Here are a couple of links that do discuss DTOs.

    http://martinfowler.com/eaaCatalog/dataTransferObject.html

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnpatterns/html/ImpDTOtypedDataSet.asp



  • DotKu

    No one :-)
  • PhotoJoe

    As a general rule the objects of a layer should only have knowledge of the layer below them. For instance, the UI layer should know what a business object is, but the reverse should not be true.

    When it comes to passing data between layers you are entering a holy war. Depending on which camp you talk to they will tell you datasets, DTO, XML, or smart business objects should be used.

    If you want to contact me outside of the forum I might be able find you article from champions of each cause. Unfortuantely I don't have the links handy right now.

    Tim Murphy



  • Jay Mertin

    If you are dealing with an N-Tier architecture on-top of a layered architecture, where the tier boundary is one of the layers boundary (usually the "business logic" or something similar) the optioned described by the others can be a good fit - the decision should be made according to the characteristics of your architecture (e.g. datasets will allow you to set everything up quickly but will be problematic if you'd have to interop with a java application)

    If you are using multiple tiers in other architectures, e.g. SOA then the information traveling between the tiers will not be data objects - rather it would be some data according to a contract (which most likely won't have a direct link to the way the data is structured inside the service) - see for example SOA Contracts - thinking in events

    Arnon



  • N-tier layer separations and connection/interaction