• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can I implement lock/unlock in DataAccessRemote?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,
I am wondering if I can implement the lock/unlock methods in a class that is not Data and does not extends Data. I implemented in DataAccessRemote that implements DataAccessRemoteInterface. Is that ok? I am in doubt because my assingment says: "modify or subclass the Data class".
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd suggest doing a search on LockManager. In this case the lock and unlock are coded into the LockManager class. No code is placed in the Data class. It is ok not to put any code into lock or unlock in the Data class.
Mark
 
Rommel Carvalho
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,
Tkx for replying so fast.
Still, I do not see why I should implement lock/unlock in a LockManager class if I can do that in the RemoteDataImpl (because in local mode there is no need for lock/unlock - so I leave Data without code in lock/unlock) and it works just fine for what I need.
Is there a reason why implementing in LockManager is better than implementing in RemoteDataImpl?
Tkx again,
Rommel Carvalho
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic