Win a copy of Serverless Applications with Node.js this week in the NodeJS 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Application Design  RSS feed

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 '' 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)


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 "", 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 (, is the above approach better or Andrew's one?

Thanks for your help.
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
global solutions you can do at home or in your backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!