Hi Dirk,
Dirk Hoffmann wrote:
>
> I think its not a good idea to copy code, to separate common things. The
> behaviour of FieldMolder and FieldHandler are nearly the same.
I can't really comment on the decision process that took place, as
Thomas was in charge of Castor JDO. However, I do know that Castor XML
needed more ability (such as arrays of primitive types) than the JDO
team wanted to provide. Changes from the XML or JDO side to add
additional behavior could easily break the other.
Good or bad, it's the way it is. If you want to fix these things, you'll
need to work with and convince the current JDO committers, and in
particular Bruce Synder. Thomas has decided to no longer work on Castor
JDO, as he wants to pursue other things in his personal time. Bruce is
currently the main contributor on Castor JDO. I am hoping he will
"officially" take over the project leadership of Castor JDO, but that's
up to him.
We could certainly use more quality JDO code contributors, so I'm happy
to see your interest in helping out.
>
> As far as I know, the sequence is as follows (please correct me, if not):
>
> MappingLoader reads the mapping file and generate the ClassDescriptors and the
> FieldDescriptors. A part of the FieldDescriptor is the FieldHandler which is
> used to access the set/get/field methods in the data classes.
Correct. MappingLoader's primary purpose is to create a set of
ClassDescriptor instances that represent the class mappings from a given
mapping file.
> Now, the ClassMolder and the FieldMolder are used only in the JDO environment.
Correct.
> OK, but what is changed in the set/get/field accessor? The FieldMolder is
> able to use the FieldHandler to access the methods.
> Duplicating code is never a good idea.
That is pretty subjective...and I am not willing to make such a
statement myself. People duplicate code all the time. Sometimes it's
good, sometimes it's not. In this case it might very well have been a
bad decision to duplicate the code. I can't say for sure because I don't
know the JDO code very well or all the reasons behind the code
duplication.
>
> BTW, what's about log4j?
>
I've never used it, so I have no personal opinions about it.
--Keith
>
> Am Dienstag, 18. Juni 2002 22:08 schrieb Keith Visco:
> > Dirk Hoffmann wrote:
> > > Hi,
> > >
> > > I take a look at the Castor implementation. Actually I see many problems
> > > arising.
> > >
> > > 1. Some classes seems to be "copy and paste". For example, the
> > > FieldMolder get... and setValue method (and some others) are nearly the
> > > same as in the FieldHandler. Why is FieldMolder not using the Methods
> > > from FieldHandler.
> >
> > Thomas decided to separate Castor JDO from Castor XML as much as
> > possible. In doing so he copied the FieldHandler to FieldMolder and made
> > some JDO specific modifications.
> >
> > > 2. I believe that adding more features into castor will blow up the code.
> > > Some parts of the code realy needs to be refactored.
> >
> > Which parts need to be refactored? Can you elaborate on your goals a
> > bit? If it's JDO specific issues please get in touch with Bruce Snyder
> > and Ned Wolpert. If it's XML, then let myself and Arnaud know! We can
> > use the list to discuss the issues so that any interested parties can
> > follow the discussion.
> >
> > --Keith
> >
> > > 3. To stop the questions about logging; why don't use log4j ;-)
> > >
> > > If there is some interrest, I will refactor some parts of the castor
> > > implementation.
> > >
> > > Dirk
> > >
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev