aspose file tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Pattern for Command line parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "Pattern for Command line parameter " Watch "Pattern for Command line parameter " New topic
Author

Pattern for Command line parameter

Prashant Purkar
Ranch Hand

Joined: May 08, 2008
Posts: 84
Hello ,

What pattern is most suitable to implement handling commnad line parameters of this form
java Appname -f FILE NAME - X 1 -Y 8 - XPOS 11


Thanks
Prashant
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Object-oriented design patterns are based on "problems".

What "problems" are you having with handling command-line parameters?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
The Reuse An Existing Library pattern - for example http://jargs.sourceforge.net/


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Prashant Purkar
Ranch Hand

Joined: May 08, 2008
Posts: 84
Thanks Ilja.

Hello James,

I have a java application that can be invoked from a command line with a possibility of 8 parameter options.
Each option indicating a different ways application can execute and their combination dicate some more complex execution ways.

I was wandering if I can encapsulate these options in a Command pattern and achieve some extensibility & modularity.

Thanks
Prashant
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pattern for Command line parameter
 
Similar Threads
MVC pattern turoail??
Spliting a string on a second space and not all spaces
RegularExpression
Authorization problem (!!!NOT SOLVED!!!)
question from beginner