Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Application Design

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I brought and finished Andrew's SCJD exam book, also read many precious articles in this forum, many thanks to this website; and hope you experts could help answer the following questions-

1.) In Andrew's book, he uses both the techiques of synchronized block and ReetrantReadLock to handle the concurrency of shared object, I intend to use Java 1.5 version to implement my assignment, will I get pentaly to only use synchronize block?

2.) The sample source 'DVDFileAccess.java' in Andrew's book,


After the execution of line 1, current thread 'A' may be blocked and the control is then passed another thread, say 'B', to complete record creation. If thread A is back and resumes the record creation, duplicate record is added. Is it a better idea to recheck UPC value after line 2?

3.) Regarding application design layer, I would like to keep it simple so it is
GUI layer -> remote layer -> Adaptor layer -> Data Access layer (Data.class -- complusory class in my assignment) -> Database layer (physical DB file manipulation)

or

GUI layer ->Adaptor layer -> Data Access layer -> Database layer

According the specification of my assigment B&S 2.2.3, Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:"

Will my design fulfill it, or do I have to remove the database layer and let the Data Access layer directly access the DB file?

4.) In database layer, I would like to create a singleton Object,


this idea is introduced by 'Head first Design Patterns', which is solely responisble any updating. Does it design still work? (According to the article "double-checked locking and the singletonattern of Peter Haggar -- old JVMs like JDK1.2.1 resuls in the out-of-order write problem, web page)

Refer to Andrew's book, he uses a static variable to declare the singleton file access object within the data access layer (database.java), is the above approach better or Andrew's one?


Thanks for your help.
 
I child proofed my house but they still get in. Distract them with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!