The most intelligent Java IDE
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
Author

Pattern for Command line parameter

Prashant Purkar
Ranch Hand

Joined: May 08, 2008
Messages: 83

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
Henry Pinkerton
Ranch Hand

Joined: Apr 16, 2008
Messages: 1266

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
Messages: 14091

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
Messages: 83

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
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
replay challenge