[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Collection-problem [Re: opp bug?]
On Monday, December 11, 2000, at 11:44 AM, Falko Braeutigam wrote:
> On Sun, 10 Dec 2000, Andreas Monitzer wrote:
> > On Sunday, December 10, 2000, at 04:55 PM, Falko Braeutigam wrote:
> >
> > > Guys, serializing just an inner class (without the outer one) never works in
> > > Java. We have to provide a solution for mentioned collection problem but in
> > > general the problems of serializing inner classes are not caused by ozone.
> > > The semantics of inner classes is different from C++ where this might work.
> > >
> > > Also, I cannot state in the docs that iterators not work in ozone. This
> > > wouldn't be true. It _is_ true that there is an architectural difference
> > > between ordinary Java object and database objects, which causes problems when
> > > returning ordinary iterators from database objects. But I _did_ try to explain
> > > this in the docu already. But the developer itself is never a good docu writer.
> > > I asked for help with this very often...
> >
> > It doesn't matter if it's a Java or ozone limitation, developers can't use it.
> This is simply not true.
Developers can't send values to/from their classes like they are used to with non-database objects.
> > You can't return the following things from a database object:
> > * java.util.Enumeration, java.util.Iterator
> This is true only for the Iterators that are implemented in java.util
Which are very common.
> > * java.util.Collection
> This is not even true for java.util collections. Most of them are serializable.
But not those that are returned from other java.util classes.
> > * Everything else that is not serializable
> This is true only for return values of client side calls.
I think "You can't return the following things from a database object" says that.
> > Simple, clean, understandable.
> I'm trying to force people to _understand_ the ozone architecture. IMHO this is
> much better in the long run then just stating that "iterators don't work".
But I think it's better to have a smooth learning curve and learn the details later. It's a bit frustrating if you write your first test app and the very first thing you see from your app is "java.lang.ClassCastException" (after you finally fixed the return type from an Enumeration to a Collection) and you don't know why.
The best frameworks are the ones where you don't need to know how they work. I know that it's not possible using Java serialization, but at least it should be the target.
> > btw there is also no documentation or example on how to create a non-empty
> > constructor database object.
>
> > For example, the correct Java signature for a single String would be
> > "(Ljava/lang/String;)", but ozone only accepts "java.lang.String", I don't
> > know how to supply a second parameter (an int for example).
>
> You are right, there is no such documentation. ozone is a voluntary project...
> you know?
:-)
andy
--
Description forthcoming.