0% found this document useful (0 votes)
3 views26 pages

Topic 4 Integrative Coding

The document discusses integrative coding, which focuses on the integration of various code components in software development, emphasizing testing and debugging. It covers design patterns, interfaces, inheritance, and version control, detailing their roles and importance in programming. The document also categorizes design patterns into creational, structural, and behavioral types, and explains the concept of version control in managing collaborative software projects.

Uploaded by

seiharukaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views26 pages

Topic 4 Integrative Coding

The document discusses integrative coding, which focuses on the integration of various code components in software development, emphasizing testing and debugging. It covers design patterns, interfaces, inheritance, and version control, detailing their roles and importance in programming. The document also categorizes design patterns into creational, structural, and behavioral types, and explains the concept of version control in managing collaborative software projects.

Uploaded by

seiharukaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

C H - 5

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

Inheritance and Abstract class


➢Abstract Method
• a method with only a signature without implementation

➢use the keyword abstract to declare an abstract method


Abstract Class
• A class containing one or more abstract methods is called
an abstract class.
• must be declared with a class-modifier abstract
• provides a template for further development
Inheritance
Notes:
• An abstract method cannot be declared final, as final
method cannot be overridden.
• An abstract method must be overridden in a descendent
before it can be used.
• An abstract method cannot be private (which generates a
compilation error, because private method is not visible to
the subclass and thus cannot be overridden.
Inheritance
In Java, define a subclass using the keyword "extends", e.g.,
class MyApplet extends java.applet.Applet {.....}
class Cylinder extends Circle {......}
Abstract class and inheritance in Java
Shape.java
abstract public class Shape
{
private String color; // Private member variable
public Shape (String color) // Constructor
{
this.color = color;
}
public String toString()
{
return "Shape of color=\"" + color + "\"";
}
// All Shape subclasses must implement a method called getArea()
abstract public double getArea();
}
PART
04
Versioning and version control
• Version control enables multiple people to simultaneously work on
a single project.
• Each person edits his or her own copy of the files and chooses
when to share those changes with the rest of the team.
• temporary or partial edits by one person do not interfere with
another person's work.
• enables one person to use multiple computers to work on a
project
• integrates work done simultaneously by different team members
• In rare cases, when two people make conflicting edits to the
same line of a file, then the version control system requests human
assistance in deciding what to do
• Version control gives access to historical versions of the project
• If make a mistake, roll back to a previous version.
• reproduce and understand a bug report on a past version of your
software.
• undo specific edits without losing all the work that was done in
the meanwhile.
• For any part of a file, determine when, why, and by whom it was
ever edited.
• Version control uses a repository (a database of changes) and a
working copy (checkout) where you do your work
• working copy is your personal copy of all the files in the project.
edits to this copy, without affecting your teammates. commit your
changes to a repository
• repository is database of all the edits to, and/or historical
versions (snapshots) of, your project update your working
copy to incorporate any new edits or versions
• Two varieties of version control:
1. centralized and;
2. distributed
• The main difference between centralized and distributed
version control is the number of repositories.
• In centralized version control, there is just one repository, and
in distributed version control, there are multiple repositories.
THANK YOU

You might also like