Win a copy of AWS Security this week in the Cloud/Virtualization 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
  • 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

B&S 2.1.1 non-networked mode locking

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am working on B&S 2.1.1 and in the design & analysis phase.

I am not quite sure if there's any locking needed when running the application in a standalone mode.

It mentioned in the specs "You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent client of your server".

Does that mean locking should be implemented only for the network-mode ? Please advise.

Thanks,

- Mostafa Radwan -
M.Sc | SCJP 1.4
 
Ranch Hand
Posts: 221
Scala Python Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mostafa,

Mostafa Radwan wrote:I am not quite sure if there's any locking needed when running the application in a standalone mode.



The code in your Data class must be 100% agnostic of the mode how the GUI chooses to run the application either standalone or server.

If you make it mode aware it would be extremely complex and difficult to maintain.

Look for simplicity and generic and easy to maintain and to extend but the Data class should not have any knowledge at all of how
the client code chooses to run it.


Hope this helps,


Carlos.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day Mostafa.

I have a BusinessServices class that I use when the application is in stand alone mode or in server mode.
The BusinessServices class locks a record; does anything it needs to do; unlock the record.

Locking records in stand alone mode will not cause the program to fall over and it will not corrupt the database.
So I do not see anything wrong with locking records in standalone mode.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Champions, I just want to add that the locking mechanism must work in both standalone and networked mode, otherwise, the candidate will be automatically failed.

And I agree with Carlos: the Data class must not know how the application is being run.
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic