File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Monitoring System + Command Pattern + UML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Monitoring System + Command Pattern + UML" Watch "Monitoring System + Command Pattern + UML" New topic

Monitoring System + Command Pattern + UML

Jean Marcel Bacan

Joined: Dec 04, 2012
Posts: 15
Hi guys, i'm starting with OO Design and I would like to add the command pattern to the UML design attached.

It's a very simple project to monitoring servers and data. I'm going to schedule three lists of commands (high, mid, low priority):
One command to execute query in different tables and databases.
One command to check many Webservices.
One command to check many URLS.
One command to check some data from external access.
Maybe Generic Command in the future to do another kind of verification.

I need to grow this databases sqls, urls, webservices dynamically without change the application. (Using database or properties).
If I need other kind of verification is acceptable that i do programmatically.
In the future some developer easy creates another command.
I'm trying to solve the old system problem: Many URLS or queries = Many Tasks = Thread concurrency problem.

Does Command pattern fits here?
Do I have to change some class?
My UML diagram looks correctly? (external developer needs to understand).

Thanks, any opinion will be nice. (good or not).

[Thumbnail for command.png]

Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

Yes, parallel processing is one of the problems that can be addressed with the Command Pattern.

Junilu - [How to Ask Questions] [How to Answer Questions]
Sunderam Goplalan
Ranch Hand

Joined: Oct 10, 2011
Posts: 86
The FileManager class is just to use to store the commands, correct? I believe the "execute" methods of the commands will read the File Manager, get the commands and execute the appropriate

Is there a reason you are using a "LinkedHashSet"? Did you want to maintain the order in which commands are added?

SCJP 5.0 , SCEA Java EE 5, TOGAF Certified
Jean Marcel Bacan

Joined: Dec 04, 2012
Posts: 15
Yes, just to store, some TimerTask class will read the list in FileManager over time.

Good point, the commands aren't related each other, so I don't need the know who came first.

I agree. Here's the link:
subject: Monitoring System + Command Pattern + UML
It's not a secret anymore!