Re: Clean Object Class Design -- What is it?

From: Jesper Ladegaard <jla_at_dax.dk>
Date: Sat, 28 Jul 2001 15:08:34 +0200
Message-ID: <3b62be8d$0$2661$edfadb0f_at_dspool01.news.tele.dk>


"bok" <bok_at_free.net.nz> wrote:
> > You could also define member attributes on all the involved classes for
> > bidirectional links. An additional link factory class might maintain these
> > links automatically.
>
> You might have to do something like that if the "object manager" or DBMS
> didn't maintain the relationship for you.

Call's db4o don't maintain "relationships" for you. It simply stores the Java model as-is using reflection techniques (Carl, correct me if I'm wrong). You are then "only" limited to the modeling concepts used in programming language not the database.

That's of course very nice (compared to how many other oodb's do it), but it does not change the problem. It's now just up to the developer to overcome the navigation/relationship problems discussed.

> > What I meant was a little different:
> > Given the commonly used construct "parent.child", is there a language that
> > allows getting the parent from the child?
>
> I must be missing something here. What's wrong with child.parent?

Nothing at all, it should always be possible to do that.

But, because of the weak meta-architecture used in e.g. the Java language you can't do it easily here (that is, without serious hacking). I know Carl don't like how I put it ;-) But, I have a strong opinion about this. Anyway, don't interpret this as some trigger to start another flame war - please!

So, if JADE has a more advanced model/meta-architecture that directly supports defining relationships like the ones discussed, then I guess this must be the answer to Carl's question.

You mentioned OMG, did you refer to basic IDL stuff or MOF/UML stuff?

The reason for asking is not because I'm a CORBA fan or anything but because I find the MOF stuff from OMG very interesting. That is, due to the fact we (and where I work) is using Java and because we can't live with its limited OOmodeling  constructs, MOF can actual help us.

Using techniques inspired from MOF we have managed to create our own metaarchitecture  "on top" of Java. It's still a hack but at least it's a "nice hack" :-)

For example now we can easily define all kinds of relationships between our object types. Also, developers now both have the possibility to use static (traditional) OO navigation and to navigate between classes dynamically by going though a "reflection API" (also inspired from MOF).

This way we can create dynamic client applications (such as an object browser etc.) that "knows" how to navigate between objects. Changing the object model and the client application will still work without re-compiling or anything. Also having such architecture simplifies structure-shy traversal which we uses a lot in our system.

/Jesper Received on Sat Jul 28 2001 - 15:08:34 CEST

Original text of this message