Too much information about objects. The most important thing is to master the basics, and everything becomes easier.
Here is a way to think about objects. Think of data structures in procedural languages. They are a group of fields with no behavior. Think about the functions that get pointers to these data structures and manipulate the latter. Now, instead of separating them, define functions within the definition of structures and assume that functions usually get a pointer to a data structure to control. This pointer is called this. In general, think of objects as a combination of state (data) and behavior (methods are a fancy name for functions in OOP).
This is an absolute basis. There are three more concepts that you must fully master:
Inheritance - all this relates to code reuse.
Encapsulation is all about hiding the implementation from the interface. Simply put, everything should be private until the opposite is proved.
Polymorphism. The type of the reference variable does not matter, but the type of the actual instance to find out what behavior (method) is being called. Java does not make it easy to understand this concept, because by definition everything is polymorphic .. Net makes it easier to understand when you decide what is polymorphic and what is not, therefore, noting the difference in behavior. This is achieved by a combination of virtual and redefinition.
If these concepts are well understood, you will be fine.
Last final tip: you mentioned the best books. Have you read Bruce Eckel's Thinking in Java ? I recommend this book even to people who start on .Net, as the concepts of OOP are clearly marked.
Rui Craveiro Aug 20 '09 at 15:23 2009-08-20 15:23
source share