John Mattman

Ranch Hand
+ Follow
since Feb 18, 2008
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Mattman

Thanks for your reply Roberto. One of my class has 3 listeners as inner classes. Will that going to be problem?

I have finished the coding part. Still need to generate the javadocs.
All together i have created 4 packages with just 15 classes.These are the packages





I saw lot of people posted that they had about more than 30 classes. Am i too short?
[ May 22, 2008: Message edited by: John Mattman ]
Great score. Congrats!

16 years ago
Thank you for your reply. Good luck on your SCWCD.
16 years ago
Hi John,
Congratulations. greate score. Just wondering if you did logging?
If you did, Did you wrote one log file or one for client , one for server?

16 years ago
I think the client logic should be pretty simple by just making the calls to the dao that does all the hard work. I myself provided the second filter method at the serverside.The client can use the either one of those methods based on his/her requirement changes. This is just my opinion.
Again both kind of designs are pretty good.


[ April 30, 2008: Message edited by: John Mattman ]
Fei - Congrats.

Just wondering if you could tell us what went wrong with locking?


How you guys deal with some magic number, like the index of data field?
For example, on UI portion, you have to know the index of owner field is 5
so you can set a customer ID when someone book a contractor, like
data[5] = "BS123456";

Hello Chih,

I am doing B&s version 2.3.3. As per the instructions in my assignment, the data type for customer id is 8 digit number. Does you assignment say it as an alphanumeric?.

In my assignment I have hard coded the magic value as static constant.
I am only using it for validating my database.
Hi All,

I have seen some people who passed the SCJD had mentioned that they just chose to write messages to console.

Is writing to console means nothing but using System.out.println("....")?
congrats Alexey,
Great score. Just wondering to ask you couple of questions about your design. Did you use logging? If so how many log files did your assignment created? one for client?, one for server?

I am planing to just write it console, since logging is not a requirement. But have not made my mind yet.

Also would you mind passing your configuration design?

Did you use Assertions?

[ April 26, 2008: Message edited by: John Mattman ]
16 years ago
Did some research myself and came up with this.

1) java -jar <path_and_filename> Server

read the properties file. If there is a reference about the server, present the server info for user confirmation. other wise present the gui that requires the following 3 options

i) Data base location

ii) database port( Don't know if i require this)

iii) server port

The app can get the IP address with this command "InetAddress.getLocalHost().getAddress()".

validate and persist the data to the properties file.

2) java -jar <path_and_filename> no argument

scenario 1)
Read the properties file. see if there is a reference about the
server. if there is reference then the server was run locally.
Read the ip address and port number of the server from the
properties file and start/(connect to) the server and present the
app gui.

scenario 2)

read the properties file. if there is no reference about the
server info. This means the server is running remotely or
locally(if the server is run in different folder) and the user is
presented with gui that requires the following info.

i) server name(ip address/url)

ii) port number( if the gui does not receive a port number, the
application will pass 1099(default))

validate and persist the data to the properties file.

3) java -jar <path_and_filename> Alone

pretty straight forward. read the properties file and present it in the
gui or present the gui that requires the following fields

i) database location

ii) port(don't know if we need a port number?)

validate and persist the data to the properties file.
[ April 24, 2008: Message edited by: John Mattman ]
Hi Eric,
So if my has something like value Then that means the server is installed locally right?.

if there is no property in the properties file then, the server is installed remotely and the gui should let the user type the server name right?
[ April 24, 2008: Message edited by: John Mattman ]
Hello people,
This question has been asked many many times. Still some things are not clear to me by reading
the related threads.

Here are my questions

1) can i create a package suncertify.config. In that package i want to create a java class Called Configuration which is the entry point to my application

In the Configuration class, I have a main() method constructs a dialog for configuration based on the type of argument.


java -jar <path_and_filename> Server

pops up a dialog that requires the following user input.

Server name: Is this really required? or can we get the Ip address using InetAddress.getLocalHost().getHostAddress()?.

Dblocation: This is required for the server to establish the communication with the database right?.

server Port: Is this required too? Or can we default it to 1099?

database port: Do we need it?

java -jar <path_and_filename> Alone

pops up the dialog that requires the folloing input from user

Dblocation: Needed as the client estabishes the connection with out the network code right?.

database Port: Do we need it?

java -jar <path_and_filename>

This is where i am more confused.

For this step to occur, Does the server has to be already up and running on different machine or same machine?

pops up the dialog that requires the folloing input from user

server name: ip address right?. Does it matter if the user enters the url?.

server port: do we need the port or just default 1099?.

Your input is appreciated.
[ April 24, 2008: Message edited by: John Mattman ]
Hi Mohamed,
My idea was to clean up the locks that were locked by in active clients.For example.

The client A locks the record and before the atomic operation has completed, the user closed the client A gui. In that case the record is still in the locked mode. After all this thinking, i realized that since i am doing the server side locking, the lock is released by the server side code anyway. I may not need the separate thread monitor for releasing the locks. I would remove the monitor. Thanks for your input.

I fear that your point (2) might have contravened this requirement if you assume in your code that the application should have been started previously with the "server" mode.

By this i mean, If sun says "" means both the server and client must run it means you must (1) start the server,
then (2) start the client in the same execution instance/main() method entry point.

I still could not figure out how a remote server can be started from the client. Can anybody clarify my doubt please?