SCJP
SCJP
Originally posted by Mark Thomson:
Thanks, I reckon i will wrap the low level exceptions up in my own exceptions and propogate those up to the calling class
Now after some long and hard thinking I reckon I am going to make my Schema class a singleton rather than access via a factory. I will have a getInstance(String fileName ) method. Now i don't really like this implementation of the singleton pattern but i reckon its the safest way to go.
Does anyone have concerns about forcing a singleton to take a parameter in the getInstance method??
SCJP
Originally posted by Mark Thomson:
Thanks for your reply Peter,
I know letting a singleton take a parameter is bad but I can't see how I can pass through a parameter to my singleton??
Now for the schema singleton I was thinking of using the properties file, but I don't like the idea of the app starting up for the first time, writing the dbFile location to a property file and then having the singleton read from the property file. Could have some threading issues etc.
Any ideas??
Anton Golovin ([email protected]) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
Exactly, what do they mean by configuration via a GUI? So when my application launches in networked mode, I need to allow the user to enter the i.p. address, port, file location, etc? And when in non-networked, I need to allow the user to choose where the file location is. Am I right? Secondly what does it mean that this should be stored in a file called suncertify.properties. Doesn't that mean there is a package called suncertify.properties and not an actual file called that? And what does it mean that it should be located in the current working directory? Which current working directory would that be? So here is my take from it. Before I launch the actual gui app every time, a gui window comes up allowing the client to configure the connection etc. Then, writes all of that to a file called properties.txt. On subsequent launchings of the application, the user will have the choice of configuring (which will then overwrite the current properties file) or use the properties located in the file. If it is the first time the app is being used, the properties file will be created, otherwise it will be read or overwritten the next time the app is launched? Am I right on this speculation? Let me know! I appreciate everyone's help.All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.
SCJP 1.4<br />SCJD 1.4
Originally posted by Swamy Nathan:
Heres A question about singleton.
Why use them when you can also use a class with only static fields and static methods and get same effect?
I have my own opinion on why singleton is a good idea vs the static thing but want to hear your views on it.
Originally posted by Daniel Simpson:
[QB]This is in my documentation about delivery: Exactly, what do they mean by configuration via a GUI? ...
Anton Golovin ([email protected]) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
The options will get stored in a Properties file called "suncertify.properties" in the current directory, this file will be managed using java.util.Properties.load() and .store(). The first time the program is run this file won't exist, but will be created using default values, any changes made to the properties will be saved (persisted) to this file either when changed or on exit.
SCJP 1.4<br />SCJD 1.4
Originally posted by Daniel Simpson:
When I look in my folder. It is located outside of my suncertify package. In that folder, i have my docs folder, my suncertify package (which contains my gui, sockets, and db packages), and this properties file "suncertify.properties." Am I doing this right, or should there be a package called that? Thanks again for the help!
Originally posted by Anton Golovin:
Hi, Peter! When might the ranchers see your project graded?Save for the opportunities to help aspiring test-takers, this is what also keeps me coming back to this forum - the interest in the outcome for people who did the project concurrently as I was doing it.
When are you submitting?![]()
[ November 19, 2004: Message edited by: Anton Golovin ]