Component design with java design patterns
I am creating multi thread component. Here, I am not giving low level
details of thread creation and maintenance. There are multiple threads
reading request queue, after reading xml message passing to different
class to process that message. After extracting data from doc object.
There are 2 services I have to call:
One is the webservice call and other one is normal call within component
but in different jar file. based ont these I want to design the component
all layers should decouple from each other.
In future if I want to switch off webservice call, it wouldn't disturb
other parts of code. Below is in my mind:
Controller ---> MessageProcessor --->ServiceImpl ----->service.
Controller is a class it reads message from queue
MessageProcessor has processMessage method ---> it creates serviceImpl
object and implements service interface.
serviceimpl-->it is a class
service --> interface it has 2 abstract methods (one has webservice
call,other one is call with in jar)
Please provide your thoughts on this.
No comments:
Post a Comment