Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Application Design

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.
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic