This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Facade Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Facade Pattern" Watch "Facade Pattern" New topic
Author

Facade Pattern

Ixus See
Ranch Hand

Joined: Jul 17, 2011
Posts: 160
If I implement Facade Pattern on my data.java

should my Lock manager and File Manager class be protected(accessible within the package only)?

Reason: There is no reason for other package from accessing my File and Lock manager and reduce requirement for javadoc comments :P
Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

It's good practice to only expose what is necessary. In a commercial environment this is even more important as you must support what you expose. Based on this line of thinking I would only expose classes outside of my package that need to be accessed outside of my package.

As for Java Doc comments. I would add Java Doc in exactly the same way to all my classes regardless of what the access level was on them. Reason being is that you should document all your code for other developers who come to read your code at a later point.


SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

Agree with Sean. In practice I'd probably put a lot less effort into documenting the non-public parts, but for this assignment I documented everything to the same level (and generated Javadocs to include public, protected and package access).
Ixus See
Ranch Hand

Joined: Jul 17, 2011
Posts: 160
i did document everything just that I don't want them to penalize me for my bad command of English.

=X
 
 
subject: Facade Pattern
 
Similar Threads
data.java
facade pattern
Lock Manager
Final check before upload
Worker classes - where to validate data