Page 2/5 Date conversion 28.01.2017 Size 181.29 Kb.
The most popular languages have all been designed around the prevalent architecture, called the von Neumann architecture.
v on Neumann architecture
Both data and program are stored in the same memory.
The processor is a unit separate from the memory.
and data must be piped, or transmitted, from memory to the processor.
Results of operations in the processor must be moved back to memory.
The von Neumann architecture causes the actual features of the imperative languages to be
, which model the memory cells.
, which are assignment statements based on the piping operation; store and load.
, (the instructions in a von Neumann computer are stored in adjacent cells of memory.)
the iterative form of repetition Programming Methodologies
the analysis of both the programming process and programming language design.
under intense study since 1970s.
An important reason for the research in software engineering was the shift in the major cost of computing from hardware to software.
(From 80% hardware, 20% software; To 20 % hardware, 80 % hardware)
The primary programming language deficiencies that were discovered in the 1970s were incompleteness of type checking, inadequacy of control statements, and lack of facilities for exception handling.
E.g. and the extensive Process-oriented design efforts in the area of that are taking place in the 1980s are bringing with them the need for complete language facilities for creating and controlling concurrency .
concurrent program units
Another example is the .
Object-oriented design (OOD) Object-oriented (OO) approach
It emphasizes data design, concentrating on the use of logical, or abstract, data types to solve problems.
For data abstraction to be used effectively in software system design, it should be supported by the languages used to write the system.
A Data base Application Example:
Button Dialog Box Scrollbar
User Interface Objects
ListBox Form Printer
A is a Type of entities which have common attributes and behaviour.
Examples: Employee, Printer, etc.
Object or Instance (noun)
An is a particular entity which has attributes and behaviours as defined by a object .
Examples: John, Peter, Printer-1, Printer-2, etc.
Attribute (noun or adj.)
An is a property of an object or class.
Example: Employee::Name, Employee::HKID, Printer::ModelNumber, Printer::Weight, etc.
An attribute can itself be an object or class.
Examples: Employee::Product, etc.
Objects communicate with each other through message or event passing.
Examples: Print, Save, Load, etc.
Methods are the functions defined by the or class .
Some methods are used to handle .
Examples: Print, Save, Load, etc.
Some are used to process information.
Examples: CalculateAsset, FormatPage, etc.
Employee FormatPage Form PrintPage Printer
Constructor VS Destructor
is a special method of a class which is executed once when the object is first instantiated (created). A good place to put initialisation and setup code for the object.
is a special method of a class which is executed once when the object is destroyed. A good place to release resources holding by the object.
Destructor OO methods
The THREE OO programming methods: Inheritance, Encapsulation and Polymorphism.
It separate the interface from the implementation.
It provide a well-define public interface to the user while hiding all internal complexities from them.
Why? A well-designed interface can save the user from having to know the complexities of the implementation in order to use your class/object.
How? In OO terms, an interface composes of methods and attributes visible to the user of your class.
An Employee class:
Identity the methods of an Employee from the context of the user, e.g. SignIn, SingOut, etc.
Identity the attributes of an Employee from the context of the user, e.g. StaffID, Position, Department, Salary, etc.
People (for class Employee)
is-a-kind-of Derive Class
(from class People)
Inheritance specifies the relations between classes having similar properties.
It improves software reuse, eases software maintenance and eases software integration.
OOD provides two class types, i.e. Base Class (Super-class) and Derive Class (Sub-class)
A derive class inherits all methods and attributes of the base class.
A derive class conceptually forms an “ is-a-kind-of ” relationship with the base class.
A particular function (e.g. Area()) behaves differently according to the class that the object belongs to. This is true even the object is accessed indirectly through a reference of a base class type.
It simplifies programming by treating derive classes as base classes. (E.g. for pass-by-reference parameter passing in function calls.)
It simplifies maintenance by not having to know the exact identity of the objects, making the code more general and extensible when new derive classes are created.
Allows a designer to ignore details and remain focused on the big picture. Start with a general system outline and progressively add more detail. (top-down approach)
Represented in OOD as inheritance, a derive class is-a-kind-of base class.
E.g. Employee is-a-kind-of People, having all the methods and attributes of People.
Occurs when an object is composed of other objects.
Represented in OOD as attributes of a class.
E.g. People consists-of a Name.
An object (client) uses another object (server) to accomplish some task.
An object can be both a client and a server.
E.g. A Form object uses a Printer object to print the form.
Occurs when an object acts as containers for other objects.
The containment is dynamic and usually transient, objects can be added to or removed from the container object.
Represented in OOD as a container class.
E.g. Lists, Queues, Forms, etc.
The database is protected by copyright ©ininet.org 2016