Keren Blau
Posts: 11
Nickname: kerenblau8
Registered: Jul, 2012
|
|
Re: design for reuse
|
Posted: Oct 28, 2013 2:12 PM
|
|
@yasmeenz, I think by "self-contained", you mean the idea of Encapsulation, which is one of the hallmarks of OOP.
"Encapsulation refers to the creation of self-contained modules that bind processing functions to the data. These user-defined data types are called "classes," and one instance of a class is an "object." For example, in a payroll system, a class could be Manager, and Pat and Jan could be two instances (two objects) of the Manager class. Encapsulation ensures good code modularity, which keeps routines separate and less prone to conflict with each other." (http://en.wikipedia.org/wiki/Object-oriented_programming)
Here are some Java resources you (or others) could find useful as you start out with this concept:
1) A simple tutorial, with really easy-to-grasp examples: http://way2java.com/oops-concepts/java-encapsulation-abstraction-data-hiding-and-data-binding/
2) From an official Java site: http://www.tutorialspoint.com/java/java_encapsulation.htm
3) 10 Object Oriented Design principles Java programmer should know http://blog.jelastic.com/2013/02/25/10-object-oriented-design-principles-java-programmer-should-know-guest-post/
|
|