Professional Documents
Culture Documents
Infot 1 - Chapter 4
Infot 1 - Chapter 4
Chapter Objectives:
INTRODUCTION
Integrative programming deals with an integration approaches and techniques that connect different
components of IT infrastructure- people, applications, platforms and databases to enable a secure, intra and
inter application collaboration. Integrative solutions enable an organization to integrate business processes
internally and externally with business partners to create dynamic environments that supports current and
evolving business requirements, thereby creating a global organization.
MOTIVATION
Why do you think it is important to know about Integrative Coding/Programming and Techniques?
INCULCATING CONCEPTS
In the past, data center computing was characterized by large, integrated resources called mainframes. As
shared computing resources became more decentralized and affordable, these resources split into
distributed computing layers of servers, storage, networks and software. To curb the proliferation of
distributed IT sprawl, these computing layers were pooled and virtualized for maximum efficiency and
minimum costs. Today, to be able to rapidly deploy new pooled resources, the computing layers are
delivered in a single chassis either from a single vendor or as reference architectures. This is what is now
commonly known as converged infrastructure.
The figure below outlines the four types of system architectures introduced above and their key
architectural differences and selling points.
An integrated development environment (IDE) is a software application that provides comprehensive facilities
to computer programmers for software development. An IDE normally consists of a source code editor, build
automation tools, and a debugger. Most modern IDEs have intelligent code completion. Some IDEs contain
a compiler, interpreter, or both. The boundary between an integrated development environment and other
parts of the broader software development environment is not well-defined. Sometimes a version control
system, or various tools to simplify the construction of a graphical user interface (GUI), are integrated. Many
modern IDEs also have a class browser, an object browser, and a class hierarchy diagram, for use in object-
oriented software development.
High-level language programs are usually written (coded) as ASCII text into a source code file. A unique file
extension (Examples: .asm .c .cpp .java .js .py) is used to identify it as a source code file. As you might guess
for our examples – Assembly, “C”, “C++”, Java, JavaScript, and Python, however, they are just ASCII text files
(other text files usually use the extension of .txt). The source code produced by the programmer must be
converted to an executable machine code file specifically for the computer’s CPU (usually an Intel or Intel-
compatible CPU within today’s world of computers). There are several steps in getting a program from its
source code stage to running the program on your computer. Historically, we had to use several software
programs (a text editor, a compiler, a linker, and operating system commands) to make the conversion and
run our program. However, today all those software programs with their associated tasks have been
integrated into one program. However, this one program is really many software items that create an
environment used by programmers to develop software. Thus the name: Integrated Development
Environment or IDE.
Programs written in a high-level language are either directly executed by some kind of interpreter or
converted into machine code by a compiler (and assembler and linker) for the CPU to execute. JavaScript,
Perl, Python, and Ruby are examples of interpreted programming languages. C, C++, C#, Java, and Swift are
examples of compiled programming languages. The following figure shows the progression of activity in an
IDE as a programmer enters the source code and then directs the IDE to compile and run the program.
Upon starting the IDE software the programmer usually indicates the file he or she wants to open for editing
as source code. As they make changes they might either do a “save as” or “save”. When they have finished
entering the source code, they usually direct the IDE to “compile & run” the program. The IDE does the
following steps:
If there are any unsaved changes to the source code file it has the test editor save the changes.
The compiler opens the source code file and does its first step which is executing the pre-processor compiler
directives and other steps needed to get the file ready for the second step. The #include will insert header
files into the code at this point. If it encounters an error, it stops the process and returns the user to the source
code file within the text editor with an error message. If no problems encountered it saves the source code
to a temporary file called a translation unit.
The compiler opens the translation unit file and does its second step which is converting the programming
language code to machine instructions for the CPU, a data area, and a list of items to be resolved by the
linker. Any problems encountered (usually a syntax or violation of the programming language rules) stops
the process and returns the user to the source code file within the text editor with an error message. If no
problems encountered it saves the machine instructions, data area, and linker resolution list as an object file.
The linker opens the program object file and links it with the library object files as needed. Unless all linker
items are resolved, the process stops and returns the user to the source code file within the text editor with
an error message. If no problems encountered it saves the linked objects as an executable file.
The IDE directs the operating system’s program called the loader to load the executable file into the
computer’s memory and have the Central Processing Unit (CPU) start processing the instructions. As the
user interacts with the program, entering test data, he or she might discover that the outputs are not
correct. These types of errors are called logic errors and would require the user to return to the source code
to change the algorithm.
Design pattern is a lower level framework for structuring an application that architectures. It is sometimes
called micro-architecture. A design pattern provides a general reusable solution for the common problems
occurs in software design. The patterns typically show relationships and interactions between classes or
objects. The idea is to speed up the development process by providing well tested, proven
development/design paradigm. Design patterns are programming language independent strategies for
solving a common problem. That means a design pattern represents an idea, not a particular implementation.
By using the design patterns you can make your code more flexible, reusable and maintainable.
It’s not mandatory to implement design patterns in your project always. Design patterns are not meant for
project development. Design patterns are meant for common problem-solving. Whenever there is a need,
you have to implement a suitable pattern to avoid such problems in the future. To find out which pattern to
use. You just have to try to understand the design patterns and its purposes. Only by then you will be able to
pick the right one.
The Gang of Four (GoF) Design Patterns book describes 23 patterns arranged into 3 groups.
Creational Patterns – used to help make a system independent of how its objects are
created, composed and represented.
Structural Patterns – concerned with how classes and objects are organized and composed
to build larger structures.
Behavioral Patterns – used to deal with assignment of responsibilities to objects and
communication between objects.
Creational Patterns
Abstract Factory – create instances of other objects. Ex. Creating GUI components for
different GUI toolkits.
Factory Method – common interface for creating
subclasses.
Singleton – create only one instance of a class.
BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 5|Page
A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS
Structural Patterns
Decorator – add more responsibilities to an object dynamically. Ex. Adding scrolling to a text
view.
Façade – higher level unified interface to a set of objects in a subsystem.
Proxy – interface layer between objects.
Behavioral Patterns
INHERITANCE
Inheritance derive a new class based on an existing class, with modifications or extensions. A subclass
inherits all the variables and methods from its super classes, including its immediate parent as well as all the
ancestors. It avoids duplication and reduce redundancy.
Types of Inheritance
Single - In this inheritance, a derived class is created from a single base class. In the given
example, Class A is the parent class and Class B is the child class since Class B inherits the
features and behavior of the parent class A.
Multilevel - In this inheritance, a derived class is created from another derived class. In the
given example, class c inherits the properties and behavior of class B and class B inherits the
properties and behavior of class B. So, here A is the parent class of B and class B is the parent
class of C. So, here class C implicitly inherits the properties and behavior of class A along with
Class B i.e. there is a multilevel of inheritance.
Multiple - In this inheritance, a derived class is created from more than one base class. This
inheritance is not supported by .NET Languages like C#, F# etc. and Java Language. In the
given example, class c inherits the properties and behavior of class B and class A at same level.
So, here A and Class B both are the parent classes for Class C.
Multipath - In this inheritance, a derived class is created from another derived classes and the
same base class of another derived classes. This inheritance is not supported by .NET
Languages like C#, F# etc. In the given example, class D inherits the properties and behavior
of class C and class B as well as Class A. Both class C and class B inherits the Class A. So, Class
A is the parent for Class B and Class C as well as Class D. So it's making it Multipath inheritance.
Hierarchal - In this inheritance, more than one derived classes are created from a single base
class and further child classes act as parent classes for more than one child classes. In the given
example, class A has two child class B and class D. Further, class B and class C both are having
two child - class D and E; class F and G respectively.
Hybrid - This is combination of more than one inheritance. Hence, it may be a combination
of Multilevel and Multiple inheritance or Hierarchical and Multilevel inheritance or
Hierarchical and Multipath inheritance or Hierarchical, Multilevel and Multiple inheritance.
Since .NET Languages like C#, F# etc. does not support multiple and multipath inheritance.
Hence hybrid inheritance with a combination of multiple or multipath inheritances is not
supported by .NET Languages.
Advantages of Inheritance
Disadvantages of Inheritance
In Inheritance base class and child class, both are tightly coupled. Hence if you change the
code of parent class, it will affect all the child classes.
In a class hierarchy, many data members remain unused and the memory allocated to them
is not utilized. Hence it affects the performance of your program if you have not
implemented inheritance correctly.
POLYMORPHISM
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in
OOP occurs when a parent class reference is used to refer to a child class object.
Any Java object that can pass more than one IS-A test is considered to be polymorphic. In Java, all Java
objects are polymorphic since any object will pass the IS-A test for their own type and for the class Object.
It is important to know that the only possible way to access an object is through a reference variable. A
reference variable can be of only one type. Once declared, the type of a reference variable cannot be
changed.
The reference variable can be reassigned to other objects provided that it is not declared final. The type of
the reference variable would determine the methods that it can invoke on the object.
A reference variable can refer to any object of its declared type or any subtype of its declared type. A
reference variable can be declared as a class or interface type.
Example
When we apply the reference variable facts to a Deer object reference, the following declarations are legal −
Example
All the reference variables d, a, v, o refer to the same Deer object in the heap.
Virtual Methods
In this section, I will show you how the behavior of overridden methods in Java allows you to take
advantage of polymorphism when designing your classes.
We already have discussed method overriding, where a child class can override a method in its parent. An
overridden method is essentially hidden in the parent class, and is not invoked unless the child class uses
the super keyword within the overriding method.
INTERFACES
Application Programming Interfaces are sets of requirements that govern how one application can talk to
another. Applications to share data and take actions on one another’s behalf without requiring developers
to share all of their software’s code. It define exactly how a program will interact with the rest of the
software world – saving time, resources.
Eg.: System-level APIs – cut and paste LibreOffice document into an Excel spreadsheet.
Eg.: Facebook APIs – Facebook users sign into many apps and Web sites using their Facebook ID.
Eg.: Web APIs – games let players chat, post high scores and invite friends to play via Facebook, right there
in the middle of a game.
ENRICHMENT
Sathish, K. (2012), Basic Integrative Programming Technologies: Data Integration Technology/ Architecture,
Lambert
Academic Publishing
https://www.slideshare.net/vijipriyacse/ipt-chapter-5
https://www.tutorialspoint.com/java/java_inheritance.htm
https://www.tutorialspoint.com/java/java_polymorphism.htm
https://www.tutorialspoint.com/java/java_interfaces.ht