Hi, Harold!
I think we should not have the CustomOrderBean for both Metro version and
Axis2 version at the same time.
As we metioned in the previous mail, the following code causes the
difference between Metro version and Axis2 version:
insertOrder.setFloat(4, order.getQuantity().floatValue());
The quantity field of CustomOrderBean is inherited from the generated code.
Therefore, we can not override the getters and setters with different method
signature.
The root cause of this issue is inheritance relationship. From the design
point of view, it is not a good design that the model(Custom*Bean) inherits
from input/output code(the generated code). Because the model should be a
stable concept in the code, and stable concept shouldn't depends on unstable
concept, the generateded. The change of generated code would require us to
change all the related codes.
Current design is like this:
DAL -> Custom*Bean -> Generated Code
A better solution is to remove all inheritance relationship. We can provide
a convertor which is outside Custom*Bean and the generated code.
Better design is like this:
DAL -> Custom*Bean <- converter -> Generated Code
As the structure shows, the DAL part will be completely independent. We can
easily share DAL part between Metro and WSO2.
On the other hand, using this structure is easy to share DAL between BS and
OP. As we metioned in one of the previous mail, the difficulty to share DAL
is also due to the same dependency.
On Thu, Jul 2, 2009 at 2:55 PM, Harold Carr <[email protected]> wrote:
> Hello Ming Jin,
>
> Therefore, the minimal effort to share the DAL is to decouple
>> CustomOrderBean and OrderDataBean. That is to say, we would like to
>> remove
>> the inhiratance relationship between CustomOrderBean and OrderDataBean.
>>
>
> Rather than decouple the inheritance relationship, why not just have a
> Metro version of CustomOrderBean (that inherits from the OrderDataBean
> generated by Metro's JAXB binding) and a Axis2 version of the
> CustomOrderBean (that inherits from the OrderDataBean generated by Axis2's
> AXIOM binding)?
>
> Regards,
> Harold
>
--
Ming Jin
Consultant
Thoughtworks, Inc
Mobile: +86 135-2125-6300
Email: [email protected]
MSN: [email protected]
Blog: http://blogjava.net/mingj