|
KB Article |
|
|
Mike Prestwood
|
1. Abstract Class / Abstract Member
An abstract class member is a member that is specified in a class but not implemented. Classes that inherit from the class will have to implement the abstract member. Abstract members are a technique for ensuring a common interface with descendant classes. An abstract class is a class you cannot instantiate. A pure abstract class is a class with only abstract members.
14 years ago, and updated 13 years ago
(5 Comments
, last by AkaRasty.B )
|
 Definition
 23345 Hits
|
 Coding & OO
|
Mike Prestwood
|
2. Aggregation
Aggregations indicate a whole-part relationship, and are known as "has-a" or "is part of" relationships. An Aggregation relationship is indicated by a line with a hollow diamond.
14 years ago, and updated 13 years ago
(2 Comments
, last by Maud.F )
|
 Definition |
 KB Post |
 19094 Hits
|
 Coding & OO
|
Mike Prestwood
|
3. An Introduction to Object Orientation
Overview and introduction to object orientation. When you analyze, design, and code in an OO way, you "think" about objects and their interaction. This type of thinking is more like real life where you naturally think about how "this object" relates to "that object". Classes represent the "design" of an existing object. The values or properties of an existing object is it's current state. When designing classes, OO supports many features like inheritance (like real-life where you inherit your parents characteristics), encapsulation (hiding data), and polymorphism (the ability of one thing to act like another or in different ways).
19 years ago, and updated 13 years ago
(4 Comments
, last by mprestwood )
|
 Article
 25498 Hits
|
 Coding & OO
|
Mike Prestwood
|
4. Class Constructor
Constructors are called when you instantiate an object from a class. This is where you can initialize variables and put code you wish executed each time the class is created. When you initially set the member fields and properties of an object, you are initializing the state of the object. The state of an object is the values of all it's member fields and properties at a given time.
(3 Comments
, last by tappo.k )
|
 Definition
 20780 Hits
|
 Coding & OO
|
Mike Prestwood
|
5. Class Destructor
A special class method called when an object instance of a class is destroyed. With some languages they are called when the object instance goes out of scope, with some languages you specifically have to call the destructor in code to destroy the object, and others use a garbage collector to dispose of object instances at specific times.
Desctructors are commonly used to free the object instance but with languages that have a garbage collector object instances are disposed of when appropriate. Either way, destructors or their equivalent are commonly used to free up resources allocated in the class constructor.
13 years ago, and updated 13 years ago
(1 Comments
, last by Roked1948.R )
|
 Definition
 18875 Hits
|
 Coding & OO
|
Mike Prestwood
|
6. Class Helper
A. In Dephi, class helpers allow you to extend a class without using inheritance. With a class helper, you do not have to create and use a new class descending from a class but instead you enhance the class directly and continue using it as you always have (even just with the DCU).
B. In general terms, developers sometimes use the term to refer to any class that helps out another class.
13 years ago, and updated 13 years ago
|
 Definition
 10349 Hits
|
 Coding & OO
|
Mike Prestwood
|
7. Class Visibility Specifiers
In OOP languages, members of a class have a specific scope that indicates visibility. Standard visibility includes private, protected, and public. Private members are usable by the defining class only (fully encapsulated). They are invisible outside of the class except by friendly classes.
Protected members are usable by the defining class and descendant classes only (plus friendly classes). Public members are usable wherever its class can be referenced.
|
 Definition
 18302 Hits
|
 Coding & OO
|
Mike Prestwood
|
8. Code Contract
A.k.a. Class Contract and Design by Contracts.
A contract with a method that must be true upon calling (pre) or exiting (post). A pre-condition contract must be true when the method is called. A post-condition contract must be true when exiting. If either are not true, an error is raised. For example, you can use code contracts to check for the validity of input parameters, and results
An invariant is also a code contract which validates the state of the object required by the method.
13 years ago, and updated 13 years ago
|
 Definition
 8823 Hits
|
 Coding & OO
|
Mike Prestwood
|
9. Composition
A composite relationship means that a class cannot exist by itself. It must exist as a member of another class. A composite relationship is indicated by a solid line with a solid diamond head pointing to the part class. Alternatively, you can show this relationship graphically with the part class nested in the whole class.
14 years ago, and updated 14 years ago
|
 Definition
 10715 Hits
|
 Coding & OO
|
Mike Prestwood
|
10. Encapsulation
Hidden data and methods. Encapsulation is the hiding of data and code and is often called the "black box" approach, since users of a class can't see inside the class (they can only see the class' public interface).
|
 Definition
 14712 Hits
|
 Coding & OO
|
Mike Prestwood
|
11. Inheritance
The concept of a class makes it possible to define subclasses that share some or all of the main class characteristics. This is called inheritance. Inheritance also allows you to reuse code more efficiently. In a class tree, inheritance is used to design classes vertically. (You can use Interfaces to design classes horizontally within a class tree.) With inheritance, you are defining an "is-a" relationship (i.e. a chow is-a dog). Analysts using UML call this generalization where you generalize specific classes into general parent classes.
14 years ago, and updated 13 years ago
|
 Definition |
 KB Post |
 19715 Hits
|
 Coding & OO
|
Mike Prestwood
|
12. Interface
An element of coding where you define a common set of properties and methods for use with the design of two or more classes.
Both interfaces and abstract classes are types of abstraction. With interfaces, like abstract classes, you cannot provide any implementation. However, unlike abstract classes, interfaces are not based on inheritance. You can apply an Interface to any class in your class tree. In a real sense, interfaces are a technique for designing horizontally in a class hierarchy (as opposed to inheritance where you design vertically). Using interfaces in your class design allows your system to evolve without breaking existing code.
14 years ago, and updated 13 years ago
|
 Definition
 25181 Hits
|
 Coding & OO
|
Mike Prestwood
|
13. Member Event
A custom event added by a programmer to a class. Custom created events need to be processed, usually by an event dispatcher within a framework.
|
 Definition
 8728 Hits
|
 Coding & OO
|
Mike Prestwood
|
14. Member Field
Also known as a Class Field.
A class variable defined with a specific class visibility, usually private visibility. A member property is different than a member field. A member property uses a member field to store values through accessor methods (getters and setters). For example, it is common to use a private member field to store the current value of a property. The current values of all the class member fields is the current state of the object.
14 years ago, and updated 13 years ago
|
 Definition
 11310 Hits
|
 Coding & OO
|
Mike Prestwood
|
15. Member Method
Also known as a Class Method.
A code routine that belongs to the class or an object instance (an instance of the class). Methods that belong to the class are called class methods or static methods. Methods that belong to an object instance are called instance methods, or simply methods.
When a method returns a value, it is a function method. When no value is returned (or void), it is a procedure method.
Methods frequently use method parameters to transfer data. When one object instance calls another object instance using a method with parameters, you call that messaging.
13 years ago, and updated 13 years ago
(1 Comments
, last by Andrew.S2 )
|
 Definition
 10259 Hits
|
 Coding & OO
|
Mike Prestwood
|
16. Method Overriding
Where you define or implement a virtual method in a parent class and then replace it in a descendant class.
When you decide to declare a method as virtual, you are giving permission to derived classes to extend and override the method with their own implementation. You can have the extended method call the parent method's code too.
In most OO languages you can also choose to hide a parent method. When you introduce a new implementation of the same named method with the same signature without overriding, you are hiding the parent method.
|
 Definition
15566 Hits
|
 Coding & OO
|
Mike Prestwood
|
17. OO/UML: Aggregation versus Composition
Our most popular article in the history of our online community! Explains the "is a", "has a", "uses a", and "looks like" relationships (updated May 2007). "Is a" is inheritance, "looks like" is interfaces, "has a" is aggregation, and "uses a" is composition.
20 years ago, and updated 12 years ago
(12 Comments
, last by Joann.M )
|
 Article
 119757 Hits
|
 Coding & OO
|
Mike Prestwood
|
18. Partial Class
A partial class, or partial type, is a class that can be split into two or more source code files and/or two or more locations within the same source file. Each partial class is known as a class part or just a part. Logically, partial classes do not make any difference to the compiler. The compiler puts the class together at compile time and treats the final class or type as a single entity exactly the same as if all the source code was in a single location.
13 years ago, and updated 13 years ago
|
 Definition
 14192 Hits
|
 Coding & OO
|
Mike Prestwood
|
19. Polymorphism
A coding technique where the same named function, operator, or object behaves differently depending on outside input or influences. Usually implemented as parameter overloading where the same named function is overloaded with other versions that are called either with a different type or number of parameters. Polymorphism is a general coding technique and other specific implementations are common such as inheritance, operator overloading, and interfaces.
19 years ago, and updated 13 years ago
|
 Definition
 16987 Hits
|
 Coding & OO
|
Mike Prestwood
|
20. Static Class / Static Member
A static member is a member you can have access to without instantiating the class into an object. For example, you can read and write static properties and call static methods without ever creating the class. Static members are also called class members (class methods, class properties, etc.) since they belong to the class and not to a specific object. A static class is a class that contains only static members. In the UML, these classes are described as utility classes.
14 years ago, and updated 13 years ago
(1 Comments
, last by Anonymous )
|
 Definition |
 Article |
 21377 Hits
|
 Coding & OO
|