Cuprins
- LO1.1 Programming language in OBJ 3
- LO1.2 ADVANTAGES OBJ ..5
- LO2.1 DESIGN 9
- 2.2 UML class diagram .10
- LO3.1 SOFTWARE DESIGN .11
- LO3.2 COMMENTS . 23
- LO3.2 Control Structures Statements .. .26
- LO4 TASK: TESTING PROGRAM 32
- 4.1 TEST TYPE 32
- 4.2 TEST PLAN 36
- 4.3 Personal Feedback 37
- 4.4 STEPS TO USE THE PROGRAM 37
- 4.5 Program documentation 38
- 5 Bibliography 39
Extras din proiect
LO1.1 Programming language in OBJ
Object Oriented Programming (POO) is a design and implementation method in which programs are represented as object collections that interact with each other through messages.
Object Oriented Programming Languages (Negrescu, 2005):
C ++
C #
Java
The main concepts behind the POO are:
-abstraction
-encapsulation
-modularity
-ranking
Abstraction is the process of grouping data and processing methods specific to solving a problem.
Abstraction:
-expresses all the essential features of an object that make it distinguishable from other objects;
-provides a precise definition of the conceptual boundaries of objects from an external perspective.
Abstraction-Example:
Abstract Data Type "Student"
typedefstruct {char name [50];
char facultatea [30];
intanStudii;
} Student;
Instance of the abstract type "Student"
Student s = {"PopescuEduard", "Informatica", 1};
ENCAPSULATION
Combining data and methods into a single data structure, defining at the same time how the object and the rest of the program can refer to the data in the object. (Deitel)
Concept defining the availability of properties and methods to an object.
It consists in separating external objects from an object that are accessible to other objects by the internal aspects of the object that are hidden to the other objects.
modularity
A way to group logically related abstractions between them.
HIERARCHY
It's an abstraction order.
The main types are:
The legacy (hierarchy of classes) relationship between classes in which one class shares the structure and behaviour of the class or classes defined in one (semantic implies a relationship of "is a").
Aggregation (hierarchy of objects) it is the relationship between two objects in which one of the objects belongs to the other object. (Semantic involves a "part of" relationship)
Principles POO:
Polymorphism
Several functions can have the same name in the same definition domain if they can difference by number or type of call arguments (http://andrei.clubcisco.ro/cursuri/2poo/co/Curs2.PDF, 2017).
A function is polymorphic if it can execute with the same effect on some values of different types (eg operator & C).
Overriding provides the possibility to redefine methods for derived classes; the methods have the same type and the same parameters.
If several functions of the same name are defined in the same domain, each call selects the correct function by comparing the types of real call arguments with the formal arguments of the function.
double abs (double);
int abs (int);
ABS (1); // call abs (int)
abs (1.0); // call abs (double)
Functions are not allowed to differ only by the type returned.
Two functions declared with the same name refer to the same function if they are in the same domain and have identical numbers and types of arguments.
Object
An object is a representation of an entity in the real world upon which an action can be taken or an action can be taken.
An object is characterized by n names n attributes (data)
-the attribute values at a given moment define a state in methods (services, operations)
Class
A class is a collection of objects with the same structure (characteristics) and the same behavior (methods or operations)
Object
-Bicycle
Bicycle Class
-frame type attribute
wheel size
number of gears
-methods
accelerate
brakes
Identifying attributes and methods
Within a bank a bank account a holder, hip, a rate of interest, number count and can perform deposit, extraction, update, hip.
Extracting attributes:
-title, balance, interest rate, countdown
-Exception of methods
- Submission, extraction, hip update
Types of abstract data and objects
Second Definition for Objects and Classes:
A class is an implementation of an abstract data type.
It defines attributes and methods implements the data structure and the abstract data type operations.
An object is an instance of an uneven one. It is uniquely determined by its name and defines a state represented by the values of its attributes at a particular moment.
The syntax of class definition
Defining a class consists of two distinct parts:
-class statement
-implementation of that class
Syntax
class IdNumeClasa {
member state statements;
statements / definitions of membership functions;
};
Bibliografie
http://andrei.clubcisco.ro/cursuri/2poo/co/Curs2.PDF. (2017). Retrieved from http://andrei.clubcisco.ro.
https://www.testing-whiz.com/blog/understanding-white-box-testing-and. (2018). Retrieved from https://www.testing-whiz.com.
Deitel, H. D. (n.d.). Java - How to program.
Grady Booch, J. R. (1999). The Unified Modeling Language.
Negrescu, L. (2005). Limbajele C si C++ pentru începatori , Vol. II,(editia XI). In L. Negrescu. Cluj-Napoca.
Preview document
Conținut arhivă zip
- Object orienting programming.docx