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

Design Questions on SCJD

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Do i have to define all the public metthod of the Data class in the interface or I should define only the methods used in my Client in the interface ?
2.The Requirements says that
" When you submit your assignment, you must ensure
that it is packaged in such a way that it is
completely clear how the examiner should run it using a java command line"
Which means that the DNS name, port no, db file name,codebase, policy file name must be provided thru command line. I initially thought of writing a GUI screen for it but now i think i should drop that idea.
Iam i right in my desision ?
3.Is it necessary to use ' in the criteria.
"Carrier='SpeedyAir',Origin='SFO'"
Cant i just use
"Carrier=SpeedyAir,Origin=SFO" .
What is the reason for embedding the values within "'"?
I got the value in a variable . then used newvalue = oldvalue.substring( 1, oldvalue.length() -1);
Is there any other better soln than this ?
 
Gennady Shapiro
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Reshma Das:
1. Do i have to define all the public metthod of the Data class in the interface or I should define only the methods used in my Client in the interface ?
This is a very common problem in EJB. How do you enforce client/server API compatibility?
This is exactly the same scenario...The question to ask is ...should I enforce Data/Client API compatibility? Do you believe you should? If you believe you should than a superinterface is the way to go.

2.The Requirements says that
" When you submit your assignment, you must ensure
that it is packaged in such a way that it is
completely clear how the examiner should run it using a java command line"
Which means that the DNS name, port no, db file name,codebase, policy file name must be provided thru command line. I initially thought of writing a GUI screen for it but now i think i should drop that idea.
Iam i right in my desision ?

I believe the spec says you may use these command line option not "must use them". You can hardcode these values for all they care as long as you justify it in your design doc.

3.Is it necessary to use ' in the criteria.
"Carrier='SpeedyAir',Origin='SFO'"
Cant i just use
"Carrier=SpeedyAir,Origin=SFO" .
What is the reason for embedding the values within "'"?
I got the value in a variable . then used newvalue = oldvalue.substring( 1, oldvalue.length() -1);
Is there any other better soln than this ?
You must follow this defined protocol. You will lose points if you deviate from the requirements.
 
Suchak Jani
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gennady
1. Do i have to define all the public metthod of the Data class in the interface or I should define only the methods used in my Client in the interface ?
[B]This is a very common problem in EJB. How do you enforce client/server API compatibility?
This is exactly the same scenario...The question to ask is ...should I enforce Data/Client API compatibility? Do you believe you should? If you believe you should than a superinterface is the way to go.[B].
For exampale. I can see that the data class has a api to close the database. It looks obivious to me that i do no want the client to close my server side data access class.
What is your opinion on this?
Do let me know if i am completely missing the point here.
Regards
Suchak Jani
 
Gennady Shapiro
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is completely valid.
However, you are forgetting that your database should be accessible in local mode too. And here closing a database is completely valid operation.
Really it is up to you how enforce you API compatibility, if you choose to. If you are very security-causious you may do this : LocalDataI extends RemoteDataI, where LocalDataI add close() to the API set.
I think that just encompassing all public methods of Data into a super interface is good enough for this project.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic