Object orientation is all about modeling the real world information mainly through encapsulation, abstraction, polymorphism, containment, inheritance and so on. In simple words, an object contains the data structures and methods to change the content state. A typical OO run-time manages the life cycle of objects. You can create as many objects as required as long as the run-time does not over run its memory.
Service orientation requires you to encapsulate a process. The operations of a services are interaction points with the particular process. Data structures are the arguments for these operations. Service run-time shall validate the correctness of the process. Service can have multiple invocation instances, not multiple instances of service itself.
Example: TrainTicketBookingService involves a process.
- Check the train timings // interaction point
- Check the seat availability // interaction point
- Issue ticket // interaction point
There could be many ticket counters that provide this service, but as a service, TrainTicketBookingService is the only service.
It is possible to design service oriented architecture through well defined process with object orientation. However, we always need to keep in mind, our goal is the service implementation, not to expose object interactions.
Comments
Post a Comment
Thanks for your comments.