Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About the arguments of application

 
AutinHorse
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use special argument prefix to distinguish the different argument, such as for client application:
Client -SVRservername -POportnumber ...
to connect Remote server
or
Client -DBdbfile
to use local DB.
Is is OK for application or is there some better way to implement it?
 
HenkGijsbert
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why use prefixes in stead of using flags. For instance: java clientProgram -server localhost -port 1099
Another possibility is using properties:
java -Dserver=localhost -Dport=1099 clientProgram
Hope this helps,
Henk
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!