Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About GUI start

 
Gosling Gong
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, ranchers!
I have two question when start the gui.
1. in which way should I set the DataFacade to the GUI? who will instantiate the DataFacade?
I just don't like to bring the command line all the way to the instantiation of DataFacade.
2. how do you handle the directory name from Command line?
do you force user to input something like "c://user//fbn//db.db" or will change its seperator from "c:/user/fbn/db.db" after get it from command line. but it is different for Windows and Unix, how do you handle this?
thanks!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your class with your main method will create an instance of the DataAccessFacade and the controller. You will pass the Facade to the Controller via the constructor or a spereate method. I like the constructor way.
For the directory, I used the directory they start the app from using the System.getProperty('user.dir') method and append "//db.db" to it.
I don't let the user put the directory in the command line.
Mark
 
Gosling Gong
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, Mark,
but should I handle it according to different system? I mean the seperator, //db.db, did you hardcoded it?
 
Robin Underwood
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.getProperty("file.separator") will return the correct file separator for the operating system.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gosling, yes I hard coded it.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic