Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S 2.1.1 non-networked mode locking

 
Mostafa Radwan
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
 
Carlos Morillo
Ranch Hand
Posts: 221
Java Python Scala
  • 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.
 
Mxolisi Veco
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.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic