vendredi 24 juin 2016

Applying design patterns [on hold]

I am having problem with application of design patterns , i don't know whether below scenario requires design pattern .

I have implemented real-time streaming in my application , however i have not followed any design , i feel i lack design skills in me . Below is the way the real-time streaming works.

1) Polling request is made to Async servlet(PriceAsyncServlet) , all the request are hold in context in queue in AccumalateRequest.java
2) Price details are feed into mq from third party system every seconds via xml
3) Spring MDB (MessageListerner.java) listens to messages in mq
4) MDB parses the xml using XmlParser.java which uses staxParser
5) Once the xml parses data and set data in java object , the java object is updated to cache manager
6) CacheEventListener.java method get invoked since it is listener for any modification on ehcache instance, all price are set to aysnc context of asynchronous servlet and hence price is delivered to front end.

Below is the class diagram depicting the same:-

enter image description here

Could i done a better design , instead of writing a MDB,XML parser . Could i have applied any design here ? when i can apply design pattern and when i cannot apply design pattern ?

Aucun commentaire:

Enregistrer un commentaire