Tuesday, June 7, 2016

Real Encapsulation

There are OOPS concepts in java which needs to be looked into much more deeply on how they are making difference in software development with in the object world.

There are like things Inheritance , Polymorphism and Encapsulation . The interesting part is with the encapsulation since we are dealing with the object states. The object states refers to something where the object got constructed and having so and so default behaviors or properties to be initialized while constructing the object .

So why we need to worry about the object states and where the polymorphism is coming into place ?

In a plain english we are hiding somethings in our home in a safe locker or whatever to protect or hide from the bad people around around the world ..:)

The same way object once created , it should serve the purpose what it is supposed to but not the additional behavior like giving flexibility to the client to change the object behavior according to the client needs. Encapsulation is like a thing where it encapsules or protects or a kind of layer on top of objects data or state.

But it has some cons too , if you won't implement properly ..:)

Here is the good link where you can follow this one to achieve the right implementation of encapsulation.

https://dzone.com/articles/encapsulation-i-dont-think-it-means-what-you-think..

Enjoy Encapsulation ..:)

No comments:

Post a Comment