• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question about scjd

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on Bodgitt and Scarper, v2.3.2. I am not quite understand the tasks to do, can some one give me the direction on understanding the assignment?

1)In non-network mode, we were told " the database and GUI must run in the same VM and must perform no networking".
Does that means that in this mode, two separate programs each containg a main() method(one is database manager, another is GUI)must start and run in the same VM? If this is case, how do they communicate? Can i just run one program(the client GUI) to read the database files instead of database manager when running under non-network mode?

2)Since the assignment only require us to implement search and book functionality, when should we use the methods "update(..)" and "delete(..)"?

3)If a customer book a record, following is what I think I should implement. Is that correct?

==Add another record to the same database, it's same to the record the ==customer is booking instead of cusotmer id.

should we let the customer enter the number of staff he need when booking the record, and then reduce the number of staff available in the master record?

4)Can anyone tell me some tutorial about jtable? I do not know how to select a record in the jtable to implement the booking functionality.

Thanks a lot!

David



2)
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


1)In non-network mode, we were told " the database and GUI must run in the same VM and must perform no networking".
Does that means that in this mode, two separate programs each containg a main() method(one is database manager, another is GUI)must start and run in the same VM? If this is case, how do they communicate?


YES.

The 2 programs can be communicated via direct method calls.


Can i just run one program(the client GUI) to read the database files instead of database manager when running under non-network mode?


It depends. But keep in mind that OO design contributes 30 points. If you duplicate the coding in the GUI and data server, I guess you may lose points from here.


2)Since the assignment only require us to implement search and book functionality, when should we use the methods "update(..)" and "delete(..)"?


The only methods you are required to provide to the client is search() and book(), and thus, the rest methods can be NOT to provide to the client.

Keep in mind that, you only need to do what the instructions told you, if the instructions do not mention anything, you can make your own decision. However, do notice that, all implementations that are NOT required by the instructions are regarded as extra functions. Doing extra functions will NOT give you any bonus marks, however, marks will be deducted if there are problems/errors/bugs in the extra functions.


3)If a customer book a record, following is what I think I should implement. Is that correct?

==Add another record to the same database, it's same to the record the ==customer is booking instead of cusotmer id.


NO. A customer can only book records that are exist inside the data file, and the records are NOT being booked.

Thus, you just need to update the record, by changing the owner id of the record.


4)Can anyone tell me some tutorial about jtable? I do not know how to select a record in the jtable to implement the booking functionality.


You may consider to read Max's excellent book SCJD with J2SE 1.4. It covers all areas that are required in SCJD.

You may find a resource page from:
http://faq.javaranch.com/view?SunCertifiedJavaDeveloperReadingMaterialFaq

Nick
 
david hu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, Nicholoas Cheung.

As you said for question 1), The 2 programs can be communicated via direct method calls. I am still not understanding your answer to my first question.

Say I have a client gui called Client.java and a data manager called Data.java. If I start them separatly both on the same local java VM like:

java Client --- start client gui
java Data --- start data manager

Is this the way to start the non-network mode of the client gui and data manger. I doubt these two programs can communicate by direct method calls, since both of them have a sperate thread running from their own main() method.

Back to my question 3), My understanding to your explanation is that the total number of records in the database is not changed. When a customer book a record, only the customer id is changed. Is that right? In this case, if one customer book a record, no other customer can book the same record in the future, is that right?
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, David:
I am sorry to say that you may not get that much help here if you don't understand Nick's answer to your first question. Max's book probably would be the last you want to read before you could reference some other fundamentals like how to work with a JTable.

I am writting this just afraid that you might be waiting too much time for someone to get back to you on issues you've raised. This forum is a great place to discuss SCJD issues but I never see its purpose is to help SCJD takers to deal with nitty gritty stuff like how to select a record from a jtable.(It may have, but I'd say it came with something else)

David, don't get me wrong here, SCJD is a gread learning process, I've learned a lot myself. If you found something hard to understand, search the web or refernce a book, lots of good resources are available. Never get discouraged.

Good luck.

Bing
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,

I am sorry that my explanations are not clear.


As you said for question 1), The 2 programs can be communicated via direct method calls. I am still not understanding your answer to my first question.

Say I have a client gui called Client.java and a data manager called Data.java. If I start them separatly both on the same local java VM like:

java Client --- start client gui
java Data --- start data manager

Is this the way to start the non-network mode of the client gui and data manger. I doubt these two programs can communicate by direct method calls, since both of them have a sperate thread running from their own main() method.


NO. In non-network mode, you dont need to start both the client and the server, since all programs resided in the same VM, and same harddisk, thus, the GUI, in fact, can *touch* the server (or the data manager) codes.

So, you can simply do this inside the Client code:



Back to my question 3), My understanding to your explanation is that the total number of records in the database is not changed. When a customer book a record, only the customer id is changed. Is that right? In this case, if one customer book a record, no other customer can book the same record in the future, is that right?


YES. As the instructions do not say that you need to allow the CSR to add (create) new records. So, I suppose, allowing CSRs to create new record via the Client GUI is an extra function, and thus, you dont need to implement it.

Nick
 
Ben Zung
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

(David) Back to my question 3), My understanding to your explanation is that the total number of records in the database is not changed. When a customer book a record, only the customer id is changed. Is that right? In this case, if one customer book a record, no other customer can book the same record in the future, is that right?

[bold](Nick)YES.[/bold]



I think Nick was "Yes"ing to the first question. The second question from David is a design issue according to some discussions in the past.

I've found a lot of discussions ever since I was told to do a search on topics that I wanted to know.

Bing
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. It is only one program in the standalone mode. For example:
java Hello
- where Hello is the one big program that displays a GUI for booking/searching records. There are no 2 programs/processes here.Everything runs in only 1 jvm. Also this is single threaded only. No RMI/Sockets is to be used here in this mode.

Usually we use the same classes that we use in the client/server mode.
BTW, there are 2 programs or JVMs that run in the client/server mode.

2. The instructions in the document tell you what specific piece of funtionality you need to implement for your assignment. Mostly it would be booking() and searching() for a set of records. This is the functionality that is provider to the end-user using the application, but
the instructions also require us to implement all the functionality create, delete, update, read, find etc in the Data Access Layer ....The end-user of the application may not use all this functionality, but we have to implement them. Maybe client programs developed in the future could use this functionality on the server side.

3. If a CSR(customer) books a record, then he also enters the customer number, 8 digit number that he already knows. The functionality would be to update() the record with the customer number.

4. The number of staff is a read-only field. No updates are required.

5. The JTable tutorials at the SUN's site are good and easy enough for the assignment.

David:
The above are all with respect to the instructions given for my assignment BS 2.1.2.These may not be the same for your assignment, so check your assignment instructions. There is a lot of information given in the instructions document that is not easy to grasp in the first reading. The instructions also differ slightly, but significantly for different people.I suggest you read it again/again and come back here with questions.

Also Max's book is a good guide for the SCJD. A sample application that is similar to the actual SCJD assignment is well explained in the book. You may find the answers to your basic questions there.
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David and Bing,

Bing:
I think Nick was "Yes"ing to the first question.



Indeed, and I understand that it was confusing.

David:
Does that means that in this mode, two separate programs each containg a main() method(one is database manager, another is GUI)must start and run in the same VM?



Nicholas:
YES.



The answer is NO. Any Java application has one and only *one* main method.

David:
Can i just run one program(the client GUI) to read the database files



That's exactly what you have to do. But of course, by using the same data classes as the server uses (no recoding, just using).

Bing:
I am sorry to say that you may not get that much help here if you don't understand Nick's answer to your first question.
(...)
This forum is a great place to discuss SCJD issues but I never see its purpose is to help SCJD takers to deal with nitty gritty stuff like how to select a record from a jtable.



Bing, not only I disagree with the tone of your post above dated posted May 18, 2004 09:29 AM (please keep our JavaRanch "be-nice" rule in mind when posting), but with the false assertions it contains either. *Any* question is welcome on this forum as far as it relates to some aspect of the SCJD assignment.


Bing:
The second question from David is a design issue according to some discussions in the past.
I've found a lot of discussions ever since I was told to do a search on topics that I wanted to know



Searching on this forum is a great source of information. But it doesn't prevent anybody to come back with past topics. BTW, it's a luck or we could just archive this forum... Many past threads on similar topics lead to (slightly?) different conclusions, so it's often interesting to rediscuss them.

Best regards,

Phil.
[ May 19, 2004: Message edited by: Philippe Maquet ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
My name is Guvenc and I am on my way to SCJD so
I may bother you guys with some questions in the
following days/weeks.. :-)

Here are some questions :
-> Does SCJD have some expiration period like SCJP.
My SCJP will expire in 5 months. Does that mean I can
not take SCJD anymore and I have to take SCJP once more ?
Why expiration date ? Does the java language change
drasticly every two year ?

-> I want to keep the things simple during my implementation
and just want to do the things that are really necesssary (must)
I saw during browsing in the forum that more than one people
actually managed to get SCJD without implementing create / delete
methods. They are not used anywhere and there is nothing in
the assigment that implies that these methods need to be implemented.
But I still see in some posts that it is still being strongly adviced
to implement them by some guys in this forum. Why ?
Why should I implement them, if I can pass it withoud doing so
and when I have examples(guys passed without implementing) in
front of me ? (see this post)


2. The instructions in the document tell you what specific piece of funtionality you need to implement for your assignment. Mostly it would be booking() and searching() for a set of records. This is the functionality that is provider to the end-user using the application, but
the instructions also require us to implement all the functionality create, delete, update, read, find etc in the Data Access Layer ....The end-user of the application may not use all this functionality, but we have to implement them. Maybe client programs developed in the future could use this functionality on the server side.



Thanks for your help and here is a great forum
to gather information regarding SCJD

Guvenc Gulce
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Guvenc Gulce:
Does SCJD have some expiration period like SCJP.
My SCJP will expire in 5 months. Does that mean I can
not take SCJD anymore and I have to take SCJP once more ?
Why expiration date ? Does the java language change
drasticly every two year ?



No, ur SCJP won't expire... Cos Sun has changed its policy since mid last year that if you are certified for 1.4, then u will be certified forever for that version of JDK... So don't worry... U can even ask for a new copy of SCJP, if your current certificate has expiry date on it... At the same time, you can go ahead for SCJD... And SCJD also the same as SCJP... U will be certified forever for a certain version...

Hope it helps...
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Guvenc Gulce:
I want to keep the things simple during my implementation
and just want to do the things that are really necesssary (must)
I saw during browsing in the forum that more than one people
actually managed to get SCJD without implementing create / delete
methods. They are not used anywhere and there is nothing in
the assigment that implies that these methods need to be implemented.
But I still see in some posts that it is still being strongly adviced
to implement them by some guys in this forum. Why ?
Why should I implement them, if I can pass it withoud doing so
and when I have examples(guys passed without implementing) in
front of me ? (see this post)



Guvenc:
Welcome to the forum!...You are free to implement the minimum functionality required to pass the exam.Implementing extra features to the application deserves no credit as for as the evaluation goes.But one of the personal objectives of doing SCJD is to learn new things, which is purely a personal choice depending on the effort and time that you are willing to spend on this certification.

Coming to your question about create()/delete() methods, it is debatable!...
BTW, it is not too difficult/time consuming to provide method implementations for them

Also for the current SCJD, we are supposed to use JDK1.4.
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

Some random comments:


Originally posted by david hu
1)In non-network mode, we were told " the database and GUI must run in the same VM and must perform no networking".
Does that means that in this mode, two separate programs each containg a main() method(one is database manager, another is GUI)must start and run in the same VM? If this is case, how do they communicate?

Originally posted by Nicholas Cheung
YES.

Originally posted by Philippe Maquet:
The answer is NO. Any Java application has one and only *one* main method.



Any application can have as many main methods as you like, however this may not make much sense. And the JVM will only start one of them automatically.

One common use for this is where you want to run different applications based on a command line option. (Hmmm, sound familiar? )

So you could have something like:



In such a case my overall application has three main methods: one in StartUpWrapper, one in Server, and one in Client. However only the one in StartUpWrapper is started automatically by the JVM. The other one is started by my program.

I will let others think about whether this gives them any advantages or not .

Note that this is probably a little bit off topic from David's original question, where it sounded like he was trying to start two separate applications in the same JVM. As mentioned, this is not possible or desirable. The closest you could get to it would be to start up separate threads, but even that is not needed or desirable.

So David: I think your question was answered in one of the earlier threads, but if you are still uncertain, please ask again.


Originally posted by Bing Yuen
I am sorry to say that you may not get that much help here if you don't understand Nick's answer to your first question.
(...)
This forum is a great place to discuss SCJD issues but I never see its purpose is to help SCJD takers to deal with nitty gritty stuff like how to select a record from a jtable.

Originally posted by Philippe Maquet
Bing, not only I disagree with the tone of your post above dated posted May 18, 2004 09:29 AM (please keep our JavaRanch "be-nice" rule in mind when posting), but with the false assertions it contains either. *Any* question is welcome on this forum as far as it relates to some aspect of the SCJD assignment.



I agree 100% with Phil's comments here.

JavaRanch is designed to be a friendly place, and any question relating to SCJD is welcome in this forum.

It is always possible that two people will read the same answer to a question, and one person will think it answers the question perfectly, and another person will not understand a word of it. This can be for a number of reasons, especially language issues and just the way a person's mind works (a person who always works with EJBs may try and relate the answer back to EJBs which may not be the appropriate way to think about it).

I would much prefer to have someone say that they don't understand the answer and have a chance to explain it a different way than to have someone keep quiet and have mistaken beliefs about how Java works.


Originally posted by Guvenc Gulce
-> Does SCJD have some expiration period like SCJP.
My SCJP will expire in 5 months. Does that mean I can
not take SCJD anymore and I have to take SCJP once more ?
Why expiration date ? Does the java language change
drasticly every two year ?



Take a look at the Sun FAQ on Recertification. As Ko Ko says, certifications no longer expire, and (if you want to) you can get your certificates re-issued without expiration dates.

Regards, Andrew
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Andrew,


Originally posted by david hu:
1)In non-network mode, we were told " the database and GUI must run in the same VM and must perform no networking".
Does that means that in this mode, two separate programs each containg a main() method(one is database manager, another is GUI)must start and run in the same VM? If this is case, how do they communicate?

Originally posted by Nicholas Cheung:
YES.

Originally posted by Philippe Maquet:
The answer is NO. Any Java application has one and only *one* main method.

Originally posted by Andrew Monkhouse:
Any application can have as many main methods as you like (...)



Then it looks like we all three (Nicholas, Andrew and myself) are wrong (David cannot be as he just asked a question ).

Andrew, I think you just played with the words here. It's common use to say "the application's main method" as a shortcut for "the application's main class's main method". So telling that "Any application can have as many main methods as you like" is as true (and false ) than telling that "Any application can have as many toString() methods as you like" . An "application" having no methods (only classes have), it's even more "as false" than "as true". BTW, even expanded to "the application's main class's main method", the definition is not precise enough, as the application's main class could have multiple main (overloaded ) methods.

So the correct answer should be (but wasn't it understood?): any application has one and only one main class with exactly one main method having the exact signature "public static void main(String[] args)".

Best regards,

Phil.
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Phil,

You caught me - I am just being pedantic here .

I guess it is truer to say that any running application will have been started by running the only method with the signature public static void main(String[] args) within one and only one class.

The rest is just symantics.

But the assignment talks about having one "application" which runs in three modes, depending on the command line argument.

In that case, with the sample code I provided, you would be able to start it up using:



(Note that running the Server directly would not require any arguments - it is implied).

So in this case, my application does have 3 potential classes which can be used to start it's different modes, each with it's own public static void main(String[] args) method.

But of course the JVM will only consider one of these as it's starting point. If we run the StartUpWrapper and then happen to run one of the other main methods then the JVM just considers this another method - there is nothing special about it to make the JVM consider it a starting point to the application.

Regards, Andrew
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic