[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Design question



On Fri, 16 Feb 2001, Joel Shellman wrote:
> What, if any, would be the problems with setting up a database object that
> had a method called getThis() (or whatever), that returned "this". That way,
> you could get an object that you could then have local access to the data on
> the client, instead of having to deal with remote (if the db is remote)
> calls to get the data.
> 
> Basically, it's the equivalent to value objects in EJB, but simplified in
> that I don't want to have to deal with separate value objects, I just want
> to use the object itself. This would be useful for data objects that have no
> behavior, just structure, and so you just want to get all the data out
> simply. Of course you could use value objects, but I'm pretty sure there
> would be no problem with that, so I'm asking about if you could use the
> object itself (which is generally seen as not a good idea in the EJB world).

Working with the 'real object' is not a good idea in the ozone world too!
(since both have very similar basic concepts)

If you return 'this' from a method, then you actually get a proxy of 'this'
back. Test it! Unfortunately this conversion is not done recursivly yet.
(tricky to implement and time consuming) So, in fact there are ways to
serialize the database object to the client. But again, this is not a good
idea. You will loose all the advantages of the concurrent access control and
transactions.

Why do you need to access the target object? I'm still in the opinion that a
good design can help to avoid the need to access the target object. Am I to
idealistic about this?


Falko
-- 
______________________________________________________________________
Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com