Re: OOD/OOP and databases

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 09/13/04


Date: Mon, 13 Sep 2004 11:58:48 -0500

Thomas,
I would consider a Table Module & Table Data Gateway approach if my "Domain
objects" did not have any real logic to them. See
http://www.martinfowler.com/eaaCatalog/tableModule.html &
http://www.martinfowler.com/eaaCatalog/tableDataGateway.html patterns. I
consider DataSets (both typed & untyped) to be ideal for implementing Table
Module & Table Data Gateways.

However if my "Domain Objects" had heavy logic to them, then I would use a
Domain Model and Data Mapper approach. See:
http://www.martinfowler.com/eaaCatalog/domainModel.html &
http://www.martinfowler.com/eaaCatalog/dataMapper.html patterns.

> Don't you design your database the same way that you design you Business
> Model if you are responsible for all 3 layers/tiers?
I don't (at least I attempt not to) when using a Domain Model, although they
may be close. Martin's PoEAA has a number of patterns useful here.

However! with Table Module they tend to work out that way.

> How much time does you spend on writing the DAL (the mapping between the
> OO
> and the Database)? Do you use any kind of O/R Mappers to help you write
> the
> DAL?
I have not used an O/R mapper yet.

> Can you recommend any third party frameworks, which addresses any of these
> problems? I find many of the MS Reference application to be to exotic.

Rockford Lhotka's book "Expert One-on-One Visual Basic .NET Business
Objects" from A! Press provides a pre-implemented variation of Fowler's
Domain Model & Data Mapper patterns. See CSLA.NET at:
http://www.lhotka.net/

> Services. Anyone else placing the Domain Model on both the Client and
> Server?
Lhotka's CSLA.NET is leverages .NET remoting if you choose to use it.

Hope this helps
Jay

"Thomas Jespersen" <tje@nospam.mentum.dk> wrote in message
news:ecFEdt%23lEHA.2880@TK2MSFTNGP14.phx.gbl...
> Hello
>
> I've been reading a lot of great OOD/OOP books lately (e.g.. Martin
> Fowlers
> UML Distilled, Patterns of Enterprise Application Architecture,
> Refactoring,
> Kent Becks's Test Driven Development, and also a book called Design
> Patterns
> Explained.)... al of them with the focus on Java, because I think the best
> books are targeted Java. But the all fit very well to the .NET platform.
>
> I have one big problem when reading these great books, and that is that
> they
> focus almost entirely on the Domain Model (that is the Middle Layer in a 3
> layered architecture). They hardly mention that the code you write is to
> be
> used in a UI interface and committed to a database ([PoEAA] might be an
> exception). I find the separation of Business Login and UI to be the
> hardest
> thing. And also I find the performance issues when talking to the Database
> to a very tricky thing, that calls for a few hack in the Domain Layer (I'm
> almost only doing thick clients... that is no web).
>
> So I would like to know how you OO Guys really work (references to books
> or
> articles would be great).
>
> Don't you design your database the same way that you design you Business
> Model if you are responsible for all 3 layers/tiers?
>
> How much time does you spend on writing the DAL (the mapping between the
> OO
> and the Database)? Do you use any kind of O/R Mappers to help you write
> the
> DAL?
>
> Where do you place the tiers in a Smart Client configuration? The way I
> see
> it the UI and Domain Model must be on the client. Because you Domain Model
> contains a lot of information e.g. about validation the input, and I don't
> want a Server Round Trip every time the users enters something in a
> textbox.
> But I'm also thinking about putting the same domain objects on the server
> aswell and use some kind of serialization using .NET Remoting or Web
> Services. Anyone else placing the Domain Model on both the Client and
> Server?
>
> Can you recommend any third party frameworks, which addresses any of these
> problems? I find many of the MS Reference application to be to exotic.
>
> I know these are big questions for a thread in a newsgroup... but never
> the
> less, I haven't found any books or articles that really deals with these
> issues.
>
> Best regards,
> Thomas
> MCSD, MCSE+I, MCP+SB
>
>



Relevant Pages

  • Re: OOD/OOP and databases
    ... If you view the interaction with the domain model as a series of messages, ... > start with something a bit lighter which Design Patterns Explained was (a ... > business rules is much more than validation. ... > don't se much of this kind in the OO books. ...
    (microsoft.public.dotnet.general)
  • Re: What is better practice?
    ... As he covers various patterns for handling "data" both representing the ... I have used both Domain Model with Data Mappers and Table Module with Table ... Data Gateway in different solutions. ...
    (microsoft.public.dotnet.framework)
  • eQuilter ANNIVERSARY SALE!
    ... Quilting Arts TV - DVD SET ... Patterns - Apparel & APRONS ... Books - Beginners, Scrap Quilts, Fat Quarter & Log Cabin ...
    (rec.crafts.textiles.marketplace)
  • Re: Objects, objects, so many objects! ;-)
    ... We need to communicate very efficiently. ... expressions are called design patterns, ... The books are so ... The grand-daddy of the patterns books is called "Design Patterns: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Objects, objects, so many objects! ;-)
    ... We need to communicate very efficiently. ... expressions are called design patterns, ... The books are so ... The grand-daddy of the patterns books is called "Design Patterns: ...
    (microsoft.public.dotnet.general)