commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Mason" ...@rossmason.com>
Subject [Betwixt] Derived Class support
Date Fri, 02 May 2003 14:26:42 GMT
Hi James/ Robert,

 

Just to give you an update.  I've got betwixt working with most of the
functionality needed for Derived class support -

 

-          Population of derived class attributes from the BeanReader now
works.

-          It also supports population of beans with common attributes. i.e.
'Person' has an attribute 'name' only, 'Consultant' and 'Hitman' extend
Person.  They both have a attributes hourlyRate, but the attribute is not
derived.  I needed this scenario supported in my code.    Currently, only
primitive common attribute types are supported.

-          To demonstrate this I've written a new test case in the derived
package.  This tests all the old and new functionality and also tests
round-tripping.

-          I haven't had time to write support in the .betwixt files to
specify whether the className attribute should be written for a bean or made
the attribute name 'className' configurable (as James suggested) . I've been
testing the code with a derived XMLIntrospector that checks to see if the
bean being introspected is of a certain base-class type and includes a
className attribute descriptor. Maybe we should let users register derived
classes with the XMLIntrospector and determine whether the attribute should
be written automatically?

-          I've been running my project with this code for the past week
without any problems and all the existing test-cases work.

 

The code I've written does the job but there may be better ways of doing it
(especially the support for common attributes).   Betwixt as it stands is
pretty hard to extend and it's apparent that certain areas need
re-factoring/ re-architecting.  I would be keen to get involved with this,
but I'm pretty busy with other stuff for the next 6 weeks.

 

Anyway, what now? How do you want me to get the code to you so you can check
it over?

 

 

Ross

-------------------------------------------

Mobile: +44 (0) 7745 944 082

Work:  +44 (0) 20 7503 4811

Fax:      +44 (0) 20 7503 4811

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message