Re: database drive code generated software architecture




While I map db to business objects to populate data I *also*
encapsulate behaviour on the objects so yes it is quite OOP - its the
separation of concerns that is the issue.

What I find *very* interesting is reading Hibernate in action where the
author indicates that to have the data layer map data objects to
business objects is an anti-pattern and they even applaud having the
web server accessing the data objects directly.

I cant decide if it is persuasive or pervasive :-)

Michael Gaab wrote:
<timasmith@xxxxxxxxxxx> wrote in message
news:1149979248.598074.312410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
While I agree to the concept of having a stable set of interfaces
between the business layer and data layer I have found that generating
business objects which directly map to database tables works for me.


I just finished a web-based project for a company that required me to do
just
that, map each business object to each table in the db. All of this was done
manually, so each time a column changed in the db, I had to go through
and change the related business object and all of the related stored
procedures.
A time consuming and error prone activity.

This was my first project (and last) for this company so I just followed
what
they had already in place. At the time, my hunch was there must be a better
way of doing this. (By the way,
I did mention this to others on the team but each time I they became very
defensive. So I just dropped the idea.) After finishing the project,
I have investigated a number of ORM tools. From what I have read, I would
*consider* using NHibernate the next time.

If you do map your business objects directly to each db table, I don't think
you can claim to
be practicing object technology. Sure you are using objects but how do you
take advantage of the features of OO in the business model. I guess you
could
say the program is object based at best.

Conclusion: The decision as to how to map your business objects to your db
should be made on a project-by-project basis. Using ORM tools on some
projects may be overkill.

Anyway just my opinion.

Mike



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

.



Relevant Pages

  • Re: database drive code generated software architecture
    ... While I map db to business objects to populate data I *also* ... My opinions are not written in stone but my opinions are mine. ... between the business layer and data layer I have found that generating ...
    (comp.object)
  • Re: Business Object reference/dicussion
    ... LC> I seem to have a lot of questions revolving around Business Objects ... Does anyone have any good reference ... Create canonical class that will map all undefined to defined, ...
    (microsoft.public.dotnet.general)
  • Re: database drive code generated software architecture
    ... between the business layer and data layer I have found that generating ... business objects which directly map to database tables works for me. ... I have investigated a number of ORM tools. ...
    (comp.object)
  • Re: database drive code generated software architecture
    ... between the business layer and data layer I have found that generating ... business objects which directly map to database tables works for me. ... If you do map your business objects directly to each db table, ...
    (comp.object)
  • Re: Design question: transferring data between business objects and the data layer
    ... o> What is, in general, the preferred practice to transfer data between ... o> business objects and the data layer? ... The data layer take care of communicating with the ... And it's not the problem to distribute them later with using WS/COM+/.NET Remoting, the problem is the interface for the communication - your all data communications should be performed through well-known contract (read interfaces) ...
    (microsoft.public.dotnet.languages.csharp)