Parallel Comp Point Main
Parallel Comp Point Main
by speedup=𝑡𝑖𝑚𝑒𝑜𝑙𝑑 / 𝑡𝑖𝑚𝑒𝑛𝑒𝑤
•“Speedup” is a measure of performance improvement given
1. Single Core
Characteristics: No parallelism
2. multicore hardware
3. Multicore, Multiprocessors
4. Accelerators
2.2.1. Objects
In an imperative programming setting, a pure object is a
runtime software entity consisting of the following parts:
• a state defined by a set of internal objects called attributes;
• a set of subroutines called methods, which define the set of
valid messages the object may accept. The methods of an
object define the object’s valid state transformations, which
define the computational meaning of the object. The signatures
of the methods of an object form the object’s interface.
An object-oriented program comprises a set of objects that
coordinate their tasks by exchanging messages in the form of
method invocations. From the software architecture point of
view, each object addresses a concern in the dominant
decomposition of the application. Thus, coordination of objects
results in the implementation of the overall application
concern.
Concerns in software engineering. The different programming
paradigms created in the last decades primarily tried to break
the complexity of a problem by recursively dividing it into a set
of smaller subproblems that can be easier to be understood
and solved. This is software modularization. From this
perspective, a software is recursively broken into a set of
software modules, whose relation and interaction are specified.
Each module must address a software concern, which is
defined as a conceptual part of a solution such that the
composition of concerns may define the solution needed by the
software. The modularization process based on concerns is
called separation of concerns (SoC). The concrete notion of
module in a programming environment depends on the
programming paradigm. For example, object-oriented
programming uses objects to describe concerns, whereas
functional programming uses functions in a mathematical
sense.
Encapsulation
The most primitive principle behind object-oriented
programming (OOP) is encapsulation, also called information
hiding, which states that an object which knows the interface of
another object does not need to make assumptions about its
internal details to use its functionality. It only needs to
concentrate on the interface of the objects they depend on. In
fact, an OOP language statically prevents an object from
accessing the internal state of another object, by exposing only
its interface. Encapsulation prevents programmers from
concentrating on irrelevant details about the internal structure
of a particular
Implementation of an object. In fact, the implementation details
and attributes of an object may be completely modified E.G.
Pinho, E., G, and De Carvalho, F., H. (2014). Junior Science of
Computer Programming pp. 65–90. without affecting the parts
of the software that depend on the object, provided its
interface, as well as its behavior, is preserved. In this sense,
encapsulation is an important property of OOP in dealing with
software complexity and scale. More importantly, encapsulation
brings to programmers the possibility of working at higher
levels of safety and security, by allowing only essential and
valid accesses to be performed on critical subsets of the
program state.
Classes
A class is defined as a set of similar objects, presenting a set of
similar attributes and methods. Classes may also be introduced
as the programming-time counterparts of objects, often called
prototypes or templates, specifying the attributes and methods
that objects instantiated from them must carry at run time. Let
A be a class with a set of attributes α and a set of methods μ. A
Abstraction
Classes and inheritance bring four important abstraction
mechanisms to OOP
• Classification/instantiation constitutes the essence of the use
of classes. As already defined, classes group objects with
similar structure (methods and attributes). Objects represent
instances of classes.
• Aggregation/decomposition comes from the ability to have
objects as attributes of other objects. Thus, a concept
represented by an object may be described by their constituent
parts, also defined as objects, forming a recursive hierarchy of
objects that represent the structure behind the concept.
• Generalization/specialization comes from inheritance, making
it possible to recognize commonalities between different
classes of objects by creating superclasses from them. Such an
ability makes possible a kind of polymorphism that is typical in
modern OO languages, where an object reference, or variable,
that is typed with a class may refer to an object of any of its
subclasses.
• Grouping/individualization is supported due to the existence
of collection classes, which allows for the grouping together of
objects with common interests according to the application
needs. With polymorphism, collections of objects of related
classes, by inheritance relations, may be valid.
Modularity
Modularity is a way of managing complexity in software, by
promoting the division of large scale and complex systems into
collections of simple and manageable parts. There are some
accepted criteria in classifying the level of modularity achieved
by a programming method: decomposability, composability,
understandability, continuity, and protection.
OOP promotes the organization of the software in classes from
which the objects that perform the application will be
instantiated at run time. In fact, classes will be the building
blocks of OOP software. In a good design, classes capture
simple and well-defined concepts in the application domain,
orchestrating them to perform the application in the form of
objects (decomposability). Classes promote the reuse of
software parts, since the concept captured by a class of objects
may be present in several applications (composability). Indeed,
abstraction mechanisms makes it possible to reuse only those
class parts that are common between objects in distinct
applications. Encapsulation and a high functional independence
degree promote independence between classes, making it
possible to understand the meaning of a class without
examining the code of other classes it depends on
(understandability). Also, they avoid the propagation of
modifications in the requirements of a given class
implementation to other classes (continuity). Finally, exception
mechanisms makes it possible to restrict the scope of the effect
of an error condition at runtime (protection).
Functional independence
Functional independence is an important property of objects to
be achieved in the design of their classes. It is a measure of the
independence among the objects that constitute the
application. It is particularly important for the purposes of this
paper. Functional independence is calculated by two means:
cohesion and coupling. The cohesion of a class measures the
degree to which the tasks its objects perform define a
meaningful unit. Thus, a highly cohesive class addresses a
single and well-defined concern. The coupling of a class
measures its degree of dependency in relation to other classes.
Low coupling means that modifications in a class tend to cause
minor effects in other classes they depend on. Also, low
coupling minimizes propagation of errors from defective classes
to the classes they depend on. From the discussion above, we
may conclude that functional independence is better as high
cohesion and low coupling are achieved.