Re: Constructor chaining
- From: "Joanna Carter [TeamB]" <joanna@xxxxxxxxxxxx>
- Date: Fri, 7 Apr 2006 11:07:20 +0100
"Sidharth" <Sidharth@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le message de
news: BF77C7A4-BA2E-42C8-9BC8-99C3E1B0E5A4@xxxxxxxxxxxxxxxx
| Thanks for the reply. It's a very clever solution but I feel it may not be
| viable in my situation. I should've provided more information in the first
| place, sorry. What is happening is the constructor is doing 2 things:
| creating the details in the database and then initiating the object
itself.
| So originally I had only one constructor for the class:
Pardon me for saying so, but this really is not a good idea. You are tying
your business objects to a database that could change, thus forcing you to
have to change all your business classes whenever that kind of thing
happens.
Take a look at separating your business classes from their storage using
something known as an OPF (Object Persistence Framework). These creatures
use reflection to examine objects and store/retrieve/delete them from a
database without the objects knowing anything at all about databases. They
really are a better way to go.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
.
- References:
- Re: Constructor chaining
- From: the . duckman
- Re: Constructor chaining
- From: Sidharth
- Re: Constructor chaining
- Prev by Date: Re: Constructor chaining
- Next by Date: Re: Unable to properly set the InteractiveProcess property on a windows service
- Previous by thread: Re: Constructor chaining
- Next by thread: Re: Constructor chaining
- Index(es):
Relevant Pages
|