Title: Object Orientation and Aion DS
1Object Orientation and Aion DS
- An object within Aion DS is called a CLASS
- Associated functions that work with the class are
called METHODS - Classes describe the object but contain no data
2Object Orientation and Aion DS
- An object within Aion DS is called a CLASS
- Associated functions that work with the class are
called METHODS - Classes describe the object but contain no data
Class - Bank Account
Owner Balance
Data I.e. Slots
Print balance Deposit money
Methods
3Object Orientation and Aion DS
- To use an object, we must create an INSTANCE of
the class, which is a specific occurrence of that
class
Class - Bank Account
Instance 1 - Bank Account
Instance 2 - Bank Account
Owner Balance
Owner - Mr. Smith Balance - 150
Owner - Ms. Jones Balance - 2,300
Print balance Deposit money
4Object Orientation and Aion DS
- Classes can be defined in hierarchies
- This allows -
- The re-use of data definitions and procedures
- The customisation or specialisation of code
- The modeling of components within the application
domain
5Object Orientation and Aion DS
- Inheritance with Specialisation
Class - Bank Account
Owner Balance
Print balance Deposit money
Class - Current Account
Class - Deposit Account
Overdraft Limit Current Overdraft
Interest Rate
Calculate Interest
Arrange Overdraft
6Object Orientation and Aion DS
- Advantages of OO programming compared with
traditional programming approaches - Information represented in the classes and
instances is self contained and easily
transportable - Having procedures or methods centrally located in
classes helps eliminate redundancy in the
representation of procedural logic - Breaking down complex procedures into smaller
pieces of re-usable code makes procedural logic
more modular - Using class hierarchies facilitates code re-use
and enables easy customisation or specialisation
of behaviour
7Object Orientation and Aion DS
- Aion DS supports OO programming
- For very simple KBSs, where multiple classes,
inheritance, specialisation and procedural
methods, are not required, classes are still used
as the method for storing data. - Slots may be required to store inferences made by
the system. - For example in a medical diagnosis expert system
a class Person may have slots Illness and
Drugs to be taken both of which will be
inferred by the system as it makes its diagnosis
and decides upon the appropriate medicines to be
taken.