Object oriented programming. a familiar technique to some, a foreign one to others. It depends on what language a person is used to. To those familiar to it, Object Oriented Programming (OOP) is a very natural, very easy way to solve problems. It allows the programmer to take a concept they're used to and represent it as classes, interfaces, and objects. Classes can have attributes (or fields as some know them) defining the characteristics, and methods, which define its' behaviours.
Perhaps the most useful application of this concept is in creating Abstract Data Types, or ADTs. These are objects we create and model within programming languages by representing a real world concept or object within the code. Consider a well known type, the Stack. A list where new objects can only be placed on top, and removed from the top. In this case we have taken a real world concept (A stack of items) and modelled it within a programming concept by using lists and built in functions.
What other objects can you think of that we can represent as ADTS?
No comments:
Post a Comment