Meaningless Drivel is fun!
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Facade Pattern" Watch "Facade Pattern" New topic

Facade Pattern

Ixus See
Ranch Hand

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

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: 582

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

Joined: Apr 06, 2010
Posts: 4543

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.

I agree. Here's the link:
subject: Facade Pattern
It's not a secret anymore!