Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES

MODULE 4: INTEGRATIVE CODING


UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

Chapter Objectives:

1. Recognize different type of architectures for integrating systems.


2. Understand the use of integrative coding techniques like interface, inheritance and design patterns.
3. Design, implement, test, and debug simple programs in an Object- Oriented programming language.

INTRODUCTION

Integrative Coding/Programming is a technique which enables dynamic website and application


development through integration of programming and mark up languages into one for example html with
XML, JavaScript and CSS, XML with PHP, C# with XML , XML with XSLT and so on to meet the interactive and
specific dynamic end-user requirements.

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

LESSON 1: TYPES OF ARCHITECTURES FOR INTEGRATING SYSTEMS

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.

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 1|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

 Integrated – Orchestration, computing, storage and networking are tightly integrated in a


single box. System upgrade and growth is through replacement of the entire system. The architecture
is designed for a specific purpose or workload.
 Distributed – Computing and storage are in separate system blocks orchestrated separately
and connected through networks. System upgrade is through replacing component blocks. System
growth is through adding blocks. The architecture is designed to enable growth and scale out of
multiple workloads.
 Pooled – Computing, storage and networks are in separate resource pools consisting of blocks
and orchestrated separately. System upgrade is through replacing blocks within a pool. System growth
through adding blocks to a pool. The architecture is designed to enable efficient scaling and growth
of multiple workloads.
 Converged – Computing, storage and networks are in separate resource pools jointly
orchestrated and in a single chassis. System upgrade is through swapping components within the
chassis. System growth is through adding components to empty chassis slots. The architecture is
designed to support rapid deployment of multiple workloads. Within converged infrastructures the
pendulum swings back to the integrated system architecture with vendors also offering fit for purpose
versions for specific workloads. Case in point is IBM PureSystems that offers PureFlex as the generic
flavor and PureApplication for cloud and pattern workloads and PureData for big data analytics.

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 2|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

LESSON 2: INTEGRATED DEVELOPMENT ENVIRONMENT

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.

Integrated Development Environment or IDE

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 3|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

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.

LESSON 3: DESIGN PATTERNS, INHERITANCE, POLYMORPHISM, INTERFACES

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.

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 4|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

Why Design Patterns?

 Design patterns support object-oriented reuse at a high level of abstraction.


 Design patterns provide a “framework” that guides and constrains object-oriented
implementation.

Design Pattern Description Template


Section Description
Pattern Name and Classification The name of the pattern and its classification (Creational, Structural, or
Behavioral)
Intent A short statement about what the pattern does.
Also Known As Alternate well-known names for the pattern
Motivation An illustrative design problem that shows how the pattern can solve the
problem.
Applicability Situations where the pattern can be used.
Structure A graphical (UML) representation showing the classes in the pattern.
Participants The classes that participate in the pattern and their responsibilities.
Collaborations How the participants collaborate.
Consequences Benefits and trade-offs of using the pattern.
Implementation Hints, pitfalls and techniques that can be used to help implement the pattern
Sample Code Code illustrations of using the pattern.
Known Uses Examples of the pattern used in real systems.
Related Patterns Other patterns closely related to the current one.

Organizing Design Patterns

The Gang of Four (GoF) Design Patterns book describes 23 patterns arranged into 3 groups.

The groups help classify how the patterns are used.

 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.

Example for Design Patterns

 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

 Iterator – a means to access all the elements of objects sequentially.


 Momento – capture and save the current state of an object.
 Observer – when any numbers of objects (the Observers) need to be notified automatically.

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.

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 6|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

Advantages of Inheritance

 Reduce code redundancy.


 Provides code reusability.
 Reduces source code size and improves code readability.
 The code is easy to manage and divided into parent and child classes.
 Supports code extensibility by overriding the base class functionality within child classes.

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.

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 7|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

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

Let us look at an example.


public interface Vegetarian{} public
class Animal{}
public class Deer extends Animal implements Vegetarian{}
Now, the Deer class is considered to be polymorphic since this has multiple inheritance. Following are true
for the above examples −

• A Deer IS-A Animal


• A Deer IS-A Vegetarian
• A Deer IS-A Deer
• A Deer IS-A Object

When we apply the reference variable facts to a Deer object reference, the following declarations are legal −

Example

Deer d = new Deer();


Animal a = d;
Vegetarian v = d;
Object o = d;

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.

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 8|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I
INFOT 1: INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
MODULE 4: INTEGRATIVE CODING
UNIVERSITY OF ANTIQUE
LIBERTAD CAMPUS

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

BSINFOTECH 2A, 2B & 2C ARIANNE MAE A.GALLARDO, MIT 9|Page


A.Y. 2022-2023 FIRST SEMESTER INSTRUCTOR I

You might also like