• 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

Data class

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
It is possible to change the public class Data to package visibility or will this penalized?
Thanks
Pascal
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would think this would get penalized, but if you can justify it, they might allow it. Just out of my own curiosity, what is your justification for wanting to do this?
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
... Given that Data is a perfectly reusable, completely generic class whose services can be currently be usefully employed by any other package, what is the justification for withdrawing it from general circulation?
- Peter
 
pascal auderset
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
My design is like this:
Connection extends Remote
+ getService:FBNService
ConnectionImpl implements Connection
FBNService extends Remote
(all public methods form Data)
FBNServiceImpl implements FBNService
- database ata (Aggregation)
(implements "all" Methods by delegation to the dataclass)
+lock and unlock are implemented with the clientID in this class
Data
+lock and unlock are implemented as a record locking without a clientId
DataMaganger
+create ata
+close ata
This class functions as "DataSource"
So, in my implementation the Data class is only a DataAccess class which a programmer should not access directly. If he wants to get some data he should programm like this:
Connection connection = Connection.create();
FBNService service = connection.getService(database);
To call methods:
service.xxx
Thats why I would make the class package visible.
Pascal
 
reply
    Bookmark Topic Watch Topic
  • New Topic