axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Soti, Dheeraj" <ds...@harris.com>
Subject Which is a better approach to avoid polymorphism and inheritance
Date Wed, 06 Apr 2005 20:36:50 GMT
Hi,

I have class structure like as shown below. I am using doc/literal wrapped style
and I don't want to expose concepts like polymorphism, inheritance and
overloading in my service methods. There are two ways to handle this:
*	Define two different complex elements for each type of content. The
advantage is its very clear and simple. The disadvantage is that there are many
calls like findById, findByHouseId, findByName etc. So I'll end up writing
duplicate set of calls for each type of content
*	Define a single complex element with union of the fields from both and
introduce a field to store type. The advantage is that I only need single set of
calls. The disadvantage is the additional type. There is a saying that "Adding
type means killing your object".

I understand that this is not really axis related question but I will highly
appreciate if some would like to share his experience with me.

Thanks

Dheeraj Soti


                          Content
                             |
           -----------------------------------------
           |                                       |
         CommercialContent    		ProgramContent

Mime
View raw message