Recap Object Oriented Programming Book Notes
Smalltalk books are a great way to learn Object-oriented programming, because it helps rewire how you think about objects. Currently recapping my object-oriented programming knowledege with the help of Smalltalk An Introduction to Application Development using VisualWorks.
Oh.My.Gosh. This is actually the best book about Object-Oriented programming that I have ever come across!
- An object is a combination of two parts: Data - the state of the object and it's Operations - all of the mechanisms used to access and manipulate that state.
- The internal variables within the object are not directly accessible from outside the object - The barrier this provides is known as information hiding. The inside of an oject is only of interest to itself. No object can read of modify the state of any other object.
- Objects communicate by sending messages to one another. If an object understand a message, then one of it's internal methods will be performed. A result is always returned (i.e. an object).
- The set of messages to which an object responds is called its message inteface. The message specifies only which operation is requested, not how that operation is to be fulfilled.
- The object receiving a message may be able to perform the action entirely on its own, or it may ask other objects for information, pass information to other objects, all by sending messages.
- The same message sent to different objects can produce different results, since it is the receiver of the message, not the sender that decides hwat will happen as a result of the message send.