• Post Reply Bookmark Topic Watch Topic
  • New Topic

Does Axis2 support service class inheritance?  RSS feed

 
Toshi Nima
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to Axis2. I created two classes, one is the parent service class, from which the other is extended. Then I made the child class as a service in Axis2 (v1.3), but only the declared methods in the child classes are exposed, but not inherited ones. Has anyone had a similar problem before? Or do I have to configure some Axis2 runtime parameters to make it work? Thanks.
 
Paul Sigurdson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having the same problem. Anyone have a convenient way to resolve this?
 
Mintoo kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nima,

Can you please elaborate you question?

Thanks,
Mintoo
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Toshi:
Then I made the child class as a service in Axis2 (v1.3), but only the declared methods in the child classes are exposed, but not inherited ones.


I wouldn't be surprised if this is by design. You may be implementing the web service in Java which is an Object-Oriented langauge but Services are Service-Oriented and Service-Orientation doesn't support inheritance.

p.473 SOA Principles of Service Design

Use Inheritance with Care

Inter-service inheritance is not formally advocated by service-orientation in support of realizing the independence and freedom we seek to establish in every service via the Service Loose Coupling, Service Autonomy, and Service Composability principles.
Intra-service inheritance (the application of inheritance to classes encapsulated by the service) can be applied to strengthen the structure of intra-service logic, as required. However, there needs to be a constant awareness that coarse-grained services may need to be decomposed into finer-grained (more specialized) services at some point.
As per corresponding service design patterns, we can prepare for service decomposition by how we design a service's contract and logic. Service logic comprised of components tightly bound through inheritance structures will be more difficult to decompose into physically separate services than if the underlying class structures a less interdependent.


So if you want a parent method to be exposed you will have to "override and delegate" in the child class - this makes your intention absolutely clear.



However as the above quote outlines this might be an indication that you shouldn't be placing "common logic" in a parent class but place the logic to be reused in a common object to be delegated to.

Replace Inheritance With Delegation

Delegation makes reuse simpler and less restrictive with the trade off of being more verbose.

Basically these "hiccups" serve as reminders that you are not in Kansas (the Object-Oriented domain - "Home" for the Java developer) anymore but in Oz (the Services-Oriented domain).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!