Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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.
We find this kind of rampant individuality very disturbing. But not this tiny ad:
Rocket Oven Kickstarter - from the trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!