Main Page | Report this Page
Computers Forum Index  »  Computer - Object  »  Desing pattern for cmd line tool..........
Page 1 of 1    

Desing pattern for cmd line tool..........

Author Message
doublemaster007 at (no spam) gmail.com...
Posted: Fri Oct 30, 2009 9:11 pm
Guest
I have to design a cmd line tool where tool would support enabling and
desabling logs of some other programs which is my control..

for example...

managelog -enable
managelog -desable

This would enable and desable the logs of some other process whiches
each loaded many libraries...

managelog -p pid pid1 pid2 -enable

Above command would enable the logs for multiple processes...even this
operation would be supported...

managelog -p pid1 -dll dll1 -enable //This command would enable the
log for dll1 which is loaded in pid1..

is there any design patter for these kinda problems? Atleast for
command line tools..is ther any generic patter is followed??
 
johnzabroski at (no spam) gmail.com...
Posted: Fri Nov 20, 2009 10:12 pm
Guest
On Oct 30, 4:11 pm, "doublemaster... at (no spam) gmail.com"
<doublemaster... at (no spam) gmail.com> wrote:
Quote:
I have to design a cmd line tool where tool would support enabling and
desabling logs of some other programs which is my control..

for example...

managelog -enable
managelog -desable

This would enable and desable the logs of some other process whiches
each loaded many libraries...

managelog -p pid pid1 pid2 -enable

Above command would enable the logs for multiple processes...even this
operation would be supported...

managelog -p pid1 -dll dll1 -enable //This command would enable the
log for dll1 which is loaded in pid1..

is there any design patter for these kinda problems? Atleast for
command line tools..is ther any generic patter is followed??

It sounds like you want to support Inter-Process Communication (IPC).
This is not a "design pattern" in the GoF sense. It is more like a
fundamental feature of any process-based operating system.

Also, -desable should be -disable (proper spelling). -p seems to be
selecting three processes (pid, pid1, pid2).

The OO approach this requiring thinking of these processes as peers,
collaborating entities in a problem domain. Thus, your processes, in
order to be made aware of the user's logging desires, must know to
collaborate with the low-level interface hidden by managelog command-
line tool.
 
 
Page 1 of 1    
All times are GMT
The time now is Thu Dec 10, 2009 11:39 pm