• 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

Facade Pattern

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It means our mission is in jeapordy! Quick, read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic