Beruflich Dokumente
Kultur Dokumente
1
Unitied
Modeling
Language
Contents
1. The software
development challenge
Today, the complexity of developing systems has considerably
increased.
The demonstration of such complexity is not only displayed
in upsizing and functionality growth. User needs and extension
of the requirements for system quality cause not less problems,
if not more of them.
Traditional ways of resolution of the complexity problem
such as extension of development teams, specialization, and
work distribution lead to even more difficulties with reconciling
the results and ready systems integration.
A major step towards victory over the complexity was
the appearance of object-oriented programing (OOP). But
it was only a step. The appearance of OOP did not resolve
the problem of insufficient mutual understanding between
developers and users, ineffective development management
in terms of changing requirements, uncontrollability of the
changes in the course of work, subjectivity in the assessment
of the quality of the developing products, etc.
3
STEP Computer Academy
4
Lesson 1
3. Basic concepts
In itself the use of object-oriented language does not force
programmer to write object-oriented programs, though it
simplifies their development. To take the advantage of OOP,
problems must be solved in a different way than it is common
in traditional programming.
The next statement applied to natural languages is well-
known: the language that expresses the idea directs thinking.
As well as for the computer languages, it is valid for natural
languages: the language directs the thoughts, but does not
prescribe them.
In much the same way, an object-oriented engineering does
not supply programmer with a new computing power that
would allow to solve the problems beyond the reach of other
means. The object-oriented approach simplifies the task and
reorganizes it into a more natural form. This allows experts
to handle the problem in a way that fosters the management
of large software systems.
OOP is often called a new programming paradigm.
Programming paradigm is a way of conceptualizing, which
defines how to carry out calculations and how the work done
by the computer should be structured and organized.
The process of dividing tasks into separate, structurally
related, parts is called decomposition. Algorithms and data
structures processed by them are allocated for the problem
in the procedural decomposition; the rules, which connect
certain concepts, are allocated in the logic decomposition.
5
STEP Computer Academy
6
Lesson 1
4. A review of existing
methodologies
4.1. The methodology
of procedure-oriented programming
The appearance of the first electronic computers marked a new
stage in the development of computing technology. It seemed
enough to develop a sequence of elementary operations, each
of which would be converted into instructions understandable
to computer, and any computational problem could be solved.
The idea proved to be so viable that dominated the whole
process of software development for a long time. Special
programming languages that allowed to transform individual
computing operations into the appropriate code were created.
These languages include Assembler, C, Pascal, and others.
The basis of this methodology of software design is a
procedural or algorithmic organization of the code structure.
It seemed so reasonable for solving computational problems
that no one doubted the expedience of such approach.
The initial concept of this methodology is the concept of
the algorithm, which, in general, means a requirement to
perform a specified sequence of actions aimed at achieving a
certain goal or solution of the given problem.
It is commonly thought that the term «algorithm» was
named after the medieval mathematician Al-Khwarizmi, who
described the rules of performing arithmetic operations in the
decimal system in 825
7
STEP Computer Academy
8
Lesson 1
Start
Data input
Data handling
Calculation
Function call
End
9
STEP Computer Academy
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void main()
{
const int n=20;
int Mas[n];
srand(time(0));
for(int i=0;i<n;i++)
{
Mas[i] = rand()%100;
cout<<Mas[i]<<" ";
}
for(int i=0;i<n;i++)
{
bool sort = true;
for(int k=0;k<n-1;k++)
{
if(Mas[k]>Mas[k+1])
{
int n = Mas[k];
Mas[k] = Mas[k+1];
Mas[k+1]=n;
sort=false;
}
}
if(sort==true) break;
}
cout<<endl<<endl;
for(int i=0;i<n;i++)
{
cout<<Mas[i]<<" ";
}
}
11
STEP Computer Academy
12
Lesson 1
15
STEP Computer Academy
16
Lesson 1
17
STEP Computer Academy
18
Lesson 1
19
STEP Computer Academy
20
Lesson 1
e
input actions n
t
SYSTEM e output actions
r x
a i
n t
c
e
21
STEP Computer Academy
22
Lesson 1
Object Operations
Operation is a function (or conversion), which can be
applied to the objects of a given class.
All objects in this class use the same instance of each operation
(i.e., increasing the number of objects of a certain class does
not increase the number of the loaded software code). The
object, from which the operation is called, is transmitted to
it as its implicit argument (parameter this).
24
Lesson 1
25
STEP Computer Academy
Object relationships
Data dependency can be set between the objects. These
dependencies express connection or relationships between
the classes of these objects. Relationships between any two
objects are based on their mutual knowledge: what operations
can be performed and what behavior is to expect.
Types of relationships between objects.
1. Communication.
2. Aggregation
With respect to communication objects can perform different
roles:
Actor or active object: the object can influence but is never
imposed (the active object).
Server or performer: is the subject to management by other
objects but is never active.
Agent or broker: performs a role both of actor and server,
it is usually created in the active object’s interests.
26
Lesson 1
CLASS
Class is a set of objects related to the generality of structure
and behavior.
As a rule, interface (appearance visible to all and a set of methods
supported) and the implementation of the class (secure interior
device) are distinguished.
To set a class, one must specify the name of the class and then
list its attributes and operations (or methods).
Each object has an associated data structure, which fields are
attributes of the object and function designators (code fragments)
that implement the operations of the object (note that function
designators are usually replaced by references to those functions
as a result of the code optimization). Thus, the object is some data
structure, the type of which corresponds to the class of this object.
Sometimes it is necessary to redefine an operation specified
in one of its superclasses. To do this, the operation, which can be
obtained from the superclass as a result of inheritance, is defined
in the subclass as well; its re-determination «hides» its definition in
the superclass that not inherited but redefined operation is used in
the subclass. Let us recall that each operation is determined by its
signature; hence, the signature of the redefining of the operation
must match the signature of the operation of the superclass, which
is redefined by this operation.
27
STEP Computer Academy
28
Lesson 1
6. A diagram excursus
Under the structural system analysis, the method of study
of the system that begins with the general description followed
by the details of the individual aspects of its behavior and
functioning is commonly used. The general system model is
constructed in the form of a hierarchical structure that reflects
the various levels of abstraction with a limited number of
components at each of the levels. One of the main principles of
the structural system analysis is to identify the most essential
components or elements of the system at each level of abstraction.
In the context of the software engineering, three diagrammatic
notations called diagrams are considered: Entity-Relationship
Diagrams, (ERD), Structured Analysis and Design Technique
(SADT, functional simulation), and Data Flow Diagrams, DFD.
30
Lesson 1
31
STEP Computer Academy
N 1
employee works in company
32
Lesson 1
N M
employee works on project
33
STEP Computer Academy
N 1
Employee Works in Company
N 1
Works on Develops
M M
Project
34
Lesson 1
Control
Mechanism
37
STEP Computer Academy
38
Lesson 1
Credit regulations
Credit Credit
Preparation of credit
application
from client
Bank officer
AAname
nameofofthe
theexternal
externalentity
entity
41
STEP Computer Academy
a name field
Bank Bank
Give the customer the
customer employee
amount of cash
Bank terminal
Amount in cash Service protocol
D1 Account database
Today, data flow diagrams are used in some CASE tools for
building information models of data processing systems. The
main disadvantage of this methodology is also associated with
the lack of explicit funds for the object-oriented representation of
the models of complex systems, as well as for the representation
of complex data processing algorithms.
As in the diagrams DFD, runtime characteristics of individual
processes and data transfer between processes are not indicated,
the model systems implementing synchronous processing of
the data cannot be adequately represented in the notation DFD.
All these features of the methodology of structural analysis
of the system have limited the ability of its wide use and
provided the basis for the inclusion of appropriate resources
in the Unified Modeling Language.
44
Lesson 1
46
Lesson 1
49
STEP Computer Academy
50