The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
Locking
======
... I specified a contract in the Javadoc that calls for any potential users of the locking API to invoke lock/process/unlock as a sequence within the context of a single method call which guarantees it will happen within a single thread of execution.
Networking
========
... RemoteServicesImpl extends UnicastRemoteObject and implements RemoteServices. It has 2 parts, the implementation of RemoteServices (i.e. the 2 Services methods) and static getServices methods that allow the clients to get a Services instance that is either an RMI server for the Network Server application functionality or its stub for the Network Client application functionality.
Networking
========
...Since all of the locking occurs in a single method call in the Network Server's JVM, there is no need to worry about the RMI connection dieing in the middle of a locking operation.
did you have cookies in your lock()/unlock()/... methods provided by Sun?
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
Is Contractor class neccessary? Is It means good OO design? What is the benifit to use this class? How about just use a string array String[] record to represent the record data and trasmit it through networking? Because string array is serializable, and it is faster and easier to implement. To use Contractor class, you have to convert it to a string array or convert string array to Contractor back and forth sometimes.I used a Contractor class to put an O-O framework around the String arrays that represent the record data.
Is Contractor class neccessary?
Is It means good OO design?
What is the benifit to use this class?
How about just use a string array String[] record to represent the record data and trasmit it through networking?
Because string array is serializable, and it is faster and easier to implement. To use Contractor class, you have to convert it to a string array or convert string array to Contractor back and forth sometimes.
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
also use a string array as the return type. The data can be transmitted directly from db to table model without converting. I don't know why many peple use a class Record. Anyone has a good explanation?public String[] readRecord(long recNo)
Originally posted by Louis Tong:
Using Swing/AWT is a must? can I use SWT instead of Swing?
SCJP 1.4, SCJD
_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Originally posted by John Stone:
My Contractor service in B&S is also singleton. The reason is, that it has no instance attributes, so there is no need to have mutltiple instances, because they would be the same.
_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Originally posted by John Stone:
Yes, it would harm in my case.
In my implementation each contractor service creates Data class (as its data source), and my Data class states, that there should be only one instance of Data class per one db file. As the solution I made service singleton.
From singleton def. on wiki:
and I can interpret that coordination as access to one instance of Data class.
_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Originally posted by rinke hoekstra:
Hi John,
hmm interesting sollution. So your Data is not singleton, in the sense that it does not enforce only one instance, but because your service is singleton, and because it is the only one having an instance of Data, there will be automatically always one instance of Data.
However, here you make the assumption that it is more likely that the IT Manager would want to extend the Data classes, rather than the Service functionality.
originally posted 11/12/2003Grary Stimon wrote:Hi Ken,
I've found your various writings/references on RMI and B&S very helpful...
Did you return a TableModel or some other type useful to a GUI implementation from your book or search methods?
Thanks,
Grary
SCJP, SCJD
Don't get me started about those stupid light bulbs. |