Re: database drive code generated software architecture
- From: timasmith@xxxxxxxxxxx
- Date: 15 Jun 2006 18:03:17 -0700
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 =----
.
- Follow-Ups:
- Re: database drive code generated software architecture
- From: Michael Gaab
- Re: database drive code generated software architecture
- References:
- Re: database drive code generated software architecture
- From: Michael Gaab
- Re: database drive code generated software architecture
- Prev by Date: Re: Searching OO Associations with RDBMS Persistence Models
- Next by Date: Re: Let's put this to rest
- Previous by thread: Re: database drive code generated software architecture
- Next by thread: Re: database drive code generated software architecture
- Index(es):
Relevant Pages
|