Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Facade Pattern

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 590
Eclipse IDE Chrome Java
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did document everything just that I don't want them to penalize me for my bad command of English.

=X
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic