Data Access "Architecture" question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fresno Bob

    Data Access "Architecture" question

    Hi I'm creating a data access layer in which each object maps onto a
    database table. I will also be creating basic methods that return the object
    by primaryid and perform insert and update operations. I also will be
    creating methods which return collections of the object. Where should I put
    those methods that return collections of objects. Should I create a
    Collections class that corresponds with each object which just returns
    collections.

    Bear in mind I am using CodeSmith and so would like a consistant place to
    put the main object with it's properties and so forth and the methods that
    will return collections.

    Regards, Chris.


  • sloan

    #2
    Re: Data Access "Architect ure" question


    I prefer to put these methods inside a Manager or Controller class.

    CustomerManager (or CustomerControl ler)
    .Add
    .GetSingleCusto merWithOrders
    .GetSingleCusto mer
    GetAllCustomers


    You can find a downloadable example here:
    http://sholliday.space s.live.com/blog/cns!A68482B9628 A842A!176.entry
    or find the "Custom Business Object" Version 2 blog entry at the same site.




    "Fresno Bob" <nospam@nospam. comwrote in message
    news:O94SS7UDJH A.4800@TK2MSFTN GP06.phx.gbl...
    Hi I'm creating a data access layer in which each object maps onto a
    database table. I will also be creating basic methods that return the
    object by primaryid and perform insert and update operations. I also will
    be creating methods which return collections of the object. Where should I
    put those methods that return collections of objects. Should I create a
    Collections class that corresponds with each object which just returns
    collections.
    >
    Bear in mind I am using CodeSmith and so would like a consistant place to
    put the main object with it's properties and so forth and the methods that
    will return collections.
    >
    Regards, Chris.
    >

    Comment

    Working...