Originally posted by S Perreault:
1) Is this a valid design?
Originally posted by S Perreault:
2) Can we change the 'footprint' of the methods in the DBAccess class to include synchronized?
Originally posted by S Perreault:
3) If no to Q2, would it be a good idea to synchronize the DBConnector class, or should I keep the synchronization inside the Data class?
Originally posted by S Perreault:
EDIT added NX: to the beginning. I am not sure if this is the newest exam or not.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
"I'm not back." - Bill Harding, Twister
I am a bit confused where your Contractor class is. Is it a class that you are using to send data between the database and the client GUI, or is it a class on either the GUI or the database side?
Will you be using DBConnector to abstract your connection so that most of your client GUI is unaware whether it has a local or networked connection?
Originally posted by S Perreault:
My DBConnector class will receive 'records' (which are individual instances of a Contractor) convert them to the necessary String array and use these String arrays on the database side. On the return trip, the String arrays will be converted into a Contractor 'record' and used on the Client GUI. More work than necessary? Probably, if not definitely.
Originally posted by S Perreault:
Q: Should I create an Abstract Contractor class and take my current class and change it to a concrete "HomeImprovementContractor" class that derives from the Abstract Contractor class? That way, in the future, if someone has another type of Contractor, he/she could derive a new class and still use the common functionality of the Contractor class? Thanks for any insight.
Originally posted by S Perreault:
And yes, the GUI will not know if the application is being networked.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
SCJP2, SCWCD
Originally posted by Adrian Muscalu:
You might want to consider it if you decide to implement a mechanism where clients (and their locks) get removed in an elegant way. Imagine a client that lost the connection with the server or just hanged. You can release the locks this client holds.
Originally posted by Adrian Muscalu:
As a personal note, I think its implementation is not an easy job.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by S Perreault:
Whoa!
That is a crazy diagram. Thanks for taking out the time to create it.
Originally posted by S Perreault:
I totally understand that having a more multithreaded application is a better solution. I am wondering if the first example is valid.
Originally posted by S Perreault:
I would like to create a threading system like example two but all of my attempts have come to nothing.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
SCJP2, SCWCD
Crusading Chameleon likes the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|