Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

3 views
Skip to first unread message

doublem...@gmail.com

unread,
Oct 30, 2009, 5:11:43 PM10/30/09
to
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??

johnza...@gmail.com

unread,
Nov 20, 2009, 5:12:33 PM11/20/09
to
On Oct 30, 4:11 pm, "doublemaster...@gmail.com"

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.

0 new messages