Showing posts with label encapsulation. Show all posts
Showing posts with label encapsulation. Show all posts

11 February 2009

Encapsulation though access control

Encapsulation does not necessarily means getters and setters. And have more than one aspects:

  • Inside structure control.
  • Input data validation.
  • Outside access control.
Lets consider 'Outside access control'.

While we directly do not know which class calls method, it's hard to limit context of (method) call. It is possible, but amount of work is to big now time.
Any way what solutions do we have?

26 December 2008

String switch: Small language changes on JDK 7

According to Stephen Colebourne's Weblog: JDK 7 language changes - JavaEdge votes!
Allowing put String into switch statement is OK for me. But I cannot agree with placing that into JDK.
You can ask why. For me it's quite simple. Java is Object oriented language, while this change we make it more String or 'Script' oriented.