< Day Day Up > |
Objects begin as ideas or concepts that eventually become part of a solution. Think of the process as a puzzle, where each unique piece has a place in the final picture. For the puzzle to fit together, each piece must be carefully considered in regards to how it fits. This is accomplished with a blueprint methodology. Each object's defining characteristics are outlined in a blueprint or class definition. A class definition is much like an architectural blueprint, which identifies what a house will look like and what amenities it will have. A blueprint can be used many times to create many houses . The blueprint guarantees some similarities in all houses built from the blueprint. The blueprint might include details such as the following:
Each element describes what shape the final house takes and how it performs . You could say that these are the properties and functions of the house. In OOP, the blueprint of an object is called a class definition. It defines what the object does and identifies its associated data. Therefore, a class definition is a blueprint for an object that defines its properties and functions (called methods in OOP). What if an architect had to design every element of a new house? Finding an architect who is also a plumbing and heating expert might be a challenge. A better choice would be to have a heating expert design and build the heating system, a plumber to do the plumbing work, and so on. Many of the components of the house can be prebuilt. Using prebuilt objects, the complexity of building a house is greatly reduced. Prebuilt objects are tested and guaranteed by experts in the problem domain. Individual objects can be replaced without rebuilding the entire system. For example, if you decide to upgrade your heating system to a more energy-efficient system, you don't have to build a new house from scratch. You can simply replace the existing system. When we apply object-oriented principles to the problem of building a new house, we can say the following:
These same principles apply in object-oriented application development:
Using these principles enables real-world concepts to be modeled in a computer program. In ActionScript 2.0, there are many new constructs to help us employ solid object-oriented techniques in Flash MX 2004. |
< Day Day Up > |