Wednesday 16 November 2011

What is Encapsulation ... think different from your bookish world .

Hello friends i am tushar , with a simple topic , Encapsulation . today i want to explain something basic about encapsulation . surely which is beyond than your bookish world . i want to tell you something about my-life with java , when i start with java i just depend upon the book like a fool , for me if you are a lover of anything than please shutdown your books and google . and treat data like open data and edit it and built some thing new for this lovely world .

so what i read about encapsulation is , we protect our data from this entire world , but today if i say that i am fool with these protecting words than it is not a wrong statement for my state , and i am glad and enjoying my state with some new words so today for me encapsulation is used for these following words .

1. extensible
2. reliable
3. maintainable

now you follow my suggestion than i will say that encapsulation is used for extensibility / reliability / maintainability .
but why i am against protecting look at this image .

now from this image and and look at the output of this program ....

so if you have some time than please try this in your home you will find that the term protecting is never ever is related to any object , now why this is not related . this is not related because when ever a object is created it have its own copies of data so forget about data protecting .. thats why i am focusing on some new terms .

which are listed above . now its time to explaining them .

Reliable :--- now i will show you a image and think that this image is reliable for you or not .

now by seeing this program anyone in this earth can understand it easily so reliable means feasible to any layman in field of programming .

Maintainable :--- maintainable is also another important term because today my country india relies on maintenance ... so maintainability means the code is maintainable or not ... so every thing is designed very carefully because it surely it will need some maintenance in future ...

Extensibility :--- now for me the important term , why i choose this topic behind this the reason is extensibility , now i will show you a image and think that it is modifiable or not .
see at the right side i have just introduced the support class as in new form now call it or use your objects to calling your getters and setters and you will find that there is no effect in the class .

*** so now i think you can say that we all are using encapsulation not for protecting data ***
                                                                            
                                                                                                                                  thanks tushar

No comments: