The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Data class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Data class" Watch "Data class" New topic

Data class

pascal auderset

Joined: Aug 21, 2002
Posts: 15
It is possible to change the public class Data to package visibility or will this penalized?
Matt Ghiold
Ranch Hand

Joined: Feb 24, 2002
Posts: 213
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?

-Matt<br /> SCJP2<br /> SCJD
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
... 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

Joined: Aug 21, 2002
Posts: 15
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
+lock and unlock are implemented as a record locking without a clientId
+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:
Thats why I would make the class package visible.
I agree. Here's the link:
subject: Data class
It's not a secret anymore!