• 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

To: Paul Anil

 
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul:
I just read your recent post about -- "modifying a record" and "booking a seat" are operations defined at different abstract level.
I think I have a better understanding of this project now.
Lock/unlock are not about business logic. Business logic wouldn't accept -1 for seat, just like "AAA" for airport, or "BBB" for day. Business logic can be implemented through modify() methods, i.e. use a if statement.
Then what lock/unlock are all about? Without them, users will race for write. Now with lock/unlock, users race for read.
Instruction gives a example:
lock -> read -> modify -> write -> unlock.
Without lock/unlock, then this pic will be :
lock -> modify (write) -> unlock.
Here lock is provided by synchronized methods.
There were many problem with each model. For the instruction model:
(1) It is unknow how long it will take for the process, user could lock the record, then something come up, then forget all together, and this record is left to be locked.
(2) An user try to book a flight when the record was locked already. Then what should you tell the user, "Another user is booking this flight, you can read it only, when can you book it? don't know, you have to try from time to time"?
For this project, I think these things are required as basic:
(1) criteriaFind(), lock(), unlock() methods ;
(2) server class ;
(3) client class (local and remote) with GUI ;
(4) more business logic: booking flight, more search methods.
(5) communication between server/client ;
The bottom line is that user want to get all kinds of flight information and possiblly book flight through this system.
Please comment.
Thanks,
Don
 
Enthuware Software Support
Posts: 4428
41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry, I did not understand your question. Also some of your statments look contradictory. like:

Without lock/unlock, then this pic will be :
lock -> modify (write) -> unlock.



Is your confusion about the need for lock()/unlock() methods?

------------------
SCJP2 Resources, Free Question A Day, Mock Exam Results and More!
www.jdiscuss.com
Get Certified, Guaranteed!
www.enthuware.com/jqplus

Your guide to SCJD exam!
www.enthuware.com/jdevplus
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
well i dont need to say anything my question is straight.
yes i need to know more about this lock/unlock method
and if possible do send me a link to the javaworld article on lock and unlock. if you have it with you

------------------
Sid
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you write all those books, just curious.
Don
 
Evacuate the building! Here, take this tiny ad with you:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic