Topic 4 Integrative Coding
Topic 4 Integrative Coding
Integrative Coding
ITP 105 - INTEGRATIVE PROGRAMMING
CONTENTS
Design Patterns
Interface
Inheritance
Miscellaneous Issues
Integrative Coding
• software development approach that emphasizes the
integration of different code components into a unified
system.
• The process of integrative coding involves testing and
debugging each component before integrating it with
the other components.
• Integrative coding is often used in large-scale software
development projects where multiple developers or teams
work on different components of the system.
PART
01
Design Patterns
• A lower-level framework for structuring an application
than architectures
• Reusable collaborations that solve subproblems within an
application.
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 The name of the pattern, and its classification (Creational, Structural, or Behavioral).
Classification
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 patter can solve the proble,
applicability Situations where the pattern can be used.
Structure A graphical (UML) representation showing the classis in the pattern.
Participants The classes that participate in the patter and their responsibilities.
Collaborations How the participants collaborate
Consequences Benefits and trade-offs 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 twenty-three patterns
arranged into three groups.
• The groups help classify how the patterns are used.
1. Creational patterns: used to help make a system independent of how its
objects are created, composed, and represented.
2. Structural patterns are concerned with how classes and objects are
organized and composed to build larger structures.
3. Behavioral patterns are used to deal with assignment of responsibilities
to objects and communication between objects.
Examples of Design Patterns
Creational Patterns
• Abstract Factory - create instances of other objects
• Factory Method -common interface for creating subclasses
• Singleton -create only one instance of a class
Examples of Design Patterns
Structural Patterns
• Decorator - add more responsibilities to an object dynamically
• Facade- higher level unified interface to a set of objects in a subsystem
• Proxy- interface layer between objects
Examples of Design Patterns
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 number of objects (the Observers) need to be notified
automatically
PART
02
Interfaces
Application Programming Interfaces (APIs)
• 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
• define exactly how a program will interact with the rest of the
software world saving time, resources
PART
03
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
• avoid duplication and reduce redundancy
class Animal { public class Main {
void move() { public static void main(String[] args) {
System.out.println("Animal is Dog dog = new Dog();
moving.");
dog.move();
}
dog.bark();
}
}
}
class Dog extends Animal {
void bark() {
System.out.println("Dog is
barking.");
}
}
Types of Inheritance
➢ Simple, Multilevel, Multiple, hierarchical and Hybrid