0% found this document useful (0 votes)
8 views102 pages

Features of OOP: IB Computer Science

The document outlines the features of Object-Oriented Programming (OOP), focusing on encapsulation, inheritance, and polymorphism. It defines key concepts, explains their advantages and disadvantages, and discusses the importance of modularity and programming teams. The content is developed by Dartford Grammar School's Computer Science Department and serves as a guide for IB Computer Science topics.

Uploaded by

manoloregal329
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)
8 views102 pages

Features of OOP: IB Computer Science

The document outlines the features of Object-Oriented Programming (OOP), focusing on encapsulation, inheritance, and polymorphism. It defines key concepts, explains their advantages and disadvantages, and discusses the importance of modularity and programming teams. The content is developed by Dartford Grammar School's Computer Science Department and serves as a guide for IB Computer Science topics.

Uploaded by

manoloregal329
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/ 102

Features of OOP

IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.1
Define the term: encapsulation

Content developed by Dartford Grammar School Computer Science Department


Four OOP fundamentals:
• Abstraction (See Topic 4.1.17-20)
• Polymorphism (See Topic D.2.3&6)
• Inheritance (See Topic D.2.2&5)
• Encapsulation (See Topic D.2.1&4)

Content developed by Dartford Grammar School Computer Science Department


Definition: Encapsulation
• Encapsulation is the technique of making the
states in a class private and providing access
to those states via public behaviours
(methods).
• In short: data and actions are limited to the
object in which they are created

Content developed by Dartford Grammar School Computer Science Department


Encapsulation = Data Hiding
• If a state is declared private, it cannot be accessed
by any method outside the class, thereby hiding the
states (and their contents ) within the class.
• For this reason, encapsulation is also referred to as
data hiding.

Content developed by Dartford Grammar School Computer Science Department


Example: UML

Content developed by Dartford Grammar School Computer Science Department


Example: Java

Content developed by Dartford Grammar School Computer Science Department


Side note: Java keyword this
Within a method/constructor, this is a reference to the
current object (the object whose method/constructor is being
called)

Content developed by Dartford Grammar School Computer Science Department


Example of non-encapsulation: Java

This is potentially very dangerous as methods outside the class


can directly change an object’s state values.

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.2
Define the term: inheritance

Content developed by Dartford Grammar School Computer Science Department


Four OOP fundamentals:
• Abstraction (See Topic 4.1.17-20)
• Polymorphism (See Topic D.2.3&6)
• Inheritance (See Topic D.2.2&5)
• Encapsulation (See Topic D.2.1&4)

Content developed by Dartford Grammar School Computer Science Department


Definition: Inheritance
• Process whereby one object inherits the properties
(states and behaviours) of another object (pairs
called super/sub or parent/child classes)
• The Java keyword that implies inheritance is
extends

Content developed by Dartford Grammar School Computer Science Department


Key points
• In programming, inheritance is implemented by using the
keyword extends in the sub class to connect it to its super
class
• This is called an ‘is-a’ relationship (See D.1.6)
• In Java, you can only inherit from one class at a time

Content developed by Dartford Grammar School Computer Science Department


Example: UML

Super class /
Parent class

Content developed by Dartford Grammar School Computer Science Department


Example: Java

Content developed by Dartford Grammar School Computer Science Department


Example: Java

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.6
Explain the advantages of
polymorphism

Content developed by Dartford Grammar School Computer Science Department


Four OOP fundamentals:
• Abstraction (See Topic 4.1.17-20)
• Polymorphism (See Topic D.2.3&6)
• Inheritance (See Topic D.2.2&5)
• Encapsulation (See Topic D.2.1&4)

Content developed by Dartford Grammar School Computer Science Department


Reminder: Method signatures

Content developed by Dartford Grammar School Computer Science Department


Reminder: Parts of a method

Content developed by Dartford Grammar School Computer Science Department


Definition: Polymorphism
• Polymorphism is derived from 2 Greek words: poly and
morph. The word "poly" means many and "morphs" means
forms.
• So polymorphism means many forms; specifically in Java it
means that two methods can have the same name but
different contents/functions.
• In short: methods (behaviours) have the same name but
different parameter lists and processes

Content developed by Dartford Grammar School Computer Science Department


Types of Polymorphism
A. Overloading (same class)
B. Overriding (different classes/inheritance)

Content developed by Dartford Grammar School Computer Science Department


A. Overloading
• Overloading allows different methods to have same name,
but different signatures where signature can differ by
number of input parameters or type of input parameters or
both.

Content developed by Dartford Grammar School Computer Science Department


B. Overriding
• Overriding allows a sub class to
provide a specific implementation
of a method that is already
provided by one of its super
classes.
• When a method in a subclass has
the same name, same parameters
or signature and same return type
as a method in its super-class, then
the method in the subclass is said
to override the method in the
super-class.
Content developed by Dartford Grammar School Computer Science Department
Overloading vs Overriding
• Overloading is about same function have different
signatures (usually in the same class).
• Overriding is about same function, same signature but
different classes connected through inheritance.

Overriding

Content developed by Dartford Grammar School Computer Science Department


Overloading Example: Java

Content developed by Dartford Grammar School Computer Science Department


Overriding Example: Java

Content developed by Dartford Grammar School Computer Science Department


Polymorphism Comparison: Java

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.4
Explain the advantages of encapsulation

Content developed by Dartford Grammar School Computer Science Department


Four OOP fundamentals:
• Abstraction (See Topic 4.1.17-20)
• Polymorphism (See Topic D.2.3&6)
• Inheritance (See Topic D.2.2&5)
• Encapsulation (See Topic D.2.1&4)

Content developed by Dartford Grammar School Computer Science Department


Advantages of Encapsulation
A. Data Hiding
B. Increased Flexibility
C. Reusability
D. Testing code is easy

Content developed by Dartford Grammar School Computer Science Department


A. Data Hiding
• The user will have no idea about the inner
implementation of the class (implies security).
• It will not be visible to the user that how the class is
storing values in the variables.
• He/she only knows that we are passing the values to
a setter method and variables are getting initialized
with that value.

Content developed by Dartford Grammar School Computer Science Department


B. Reusability
• Encapsulation also improves the reusability of code
(write once/use many times).
• Methods can be copied to different/new classes and
help meet new requirements.

Content developed by Dartford Grammar School Computer Science Department


C. Testing code is easy
• Encapsulated code is easy to test with unit testing (a
type of automated testing that tests many different
types of data quickly).
• It is easier to fix larger programs if you know which
method is returning the wrong response.

Content developed by Dartford Grammar School Computer Science Department


D. Increased Flexibility
• We can make the variables of the class as read-only
or write-only depending on our requirement.
• If we wish to make the variables as read-only then
we can omit the setter methods
• Or if we wish to make the variables as write-only
then we have to omit the get methods

Content developed by Dartford Grammar School Computer Science Department


Exam note!
It is important to keep in mind that the scope of data
should be confined to the object in which it is defined
as far as possible in order to limit side effects and
dependencies.

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.5
Explain the advantages of inheritance

Content developed by Dartford Grammar School Computer Science Department


Four OOP fundamentals:
• Abstraction (See Topic 4.1.17-20)
• Polymorphism (See Topic D.2.3&6)
• Inheritance (See Topic D.2.2&5)
• Encapsulation (See Topic D.2.1&4)

Content developed by Dartford Grammar School Computer Science Department


Definition: Inheritance
• Process whereby one object inherits the properties
(states and behaviours) of another object (pairs
called super/sub or parent/child classes)
• The Java keyword that implies inheritance is
extends

Content developed by Dartford Grammar School Computer Science Department


Key benefit
Minimizing the amount of duplicate code in an
application by sharing common code amongst
several subclasses.

Content developed by Dartford Grammar School Computer Science Department


Other advantages of Inheritance
A. Minimize the amount of duplicate code in an
application
B. Better organization of code
C. Code more flexible change

Content developed by Dartford Grammar School Computer Science Department


A. Minimize duplicate code
If duplicate code (variables and methods) exists in
two related classes, they can be refactored into a
hierarchy by moving that common code up to a
common superclass.

Content developed by Dartford Grammar School Computer Science Department


B. Better organisation of code
Moving common code to a super class results in
better organization of code (better abstraction).

Content developed by Dartford Grammar School Computer Science Department


C. Code more flexible to change
Inheritance can also make application code more
flexible to change because classes that inherit from a
common super class can be used interchangeably.

Content developed by Dartford Grammar School Computer Science Department


Exam note!
It is important to keep in mind that a parent object
holds common data and actions, which enhances
reuse and reduces maintenance overheads.

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.6
Explain the advantages of
polymorphism

Content developed by Dartford Grammar School Computer Science Department


Four OOP fundamentals:
• Abstraction (See Topic 4.1.17-20)
• Polymorphism (See Topic D.2.3&6)
• Inheritance (See Topic D.2.2&5)
• Encapsulation (See Topic D.2.1&4)

Content developed by Dartford Grammar School Computer Science Department


Advantage: Overriding (polymorphism)
• Polymorphism is essential to object-oriented programming
for one reason: it allows a general class to specify methods
that will be common to all of its derivatives, while allowing
sub classes to define the specific implementation of some or
all of those methods.
• Overridden methods are another way that Java implements
the “one interface, multiple methods” aspect of
polymorphism
• Overridden methods allow us to call methods of any of the
derived classes without even knowing the type of derived
class object.

Content developed by Dartford Grammar School Computer Science Department


Advantage: Overloading (polymorphism)
• We don’t have to create and remember different names for
functions doing the same thing.
• For example,, if overloading was not supported by Java, we
would have to create method names like sum1, sum2,… or
sum2Int, sum3Int, … etc. for every possible combination of
parameters that might be used.

Content developed by Dartford Grammar School Computer Science Department


Overloading vs Overriding

Content developed by Dartford Grammar School Computer Science Department


Exam note!
It is important to keep in mind that an action in a child
object may chose to override actions of a parent
object.
This allows an external program to use the same
action on a family of objects without knowing the
implementation detail.

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.7
Describe the advantages of
libraries of objects

Content developed by Dartford Grammar School Computer Science Department


Biggest advantage: Time saving!
• Sorting algorithms do not have to be re-invented
• Complex algorithms and processes can be reused

Content developed by Dartford Grammar School Computer Science Department


5 Most used Java libraries
• #1: JUnit (imported by 64% of top Java projects)
– JUnit is a unit testing framework for Java programs
• #2: SLF4J (imported by 22% of top Java projects)
– SLF4J is a simple facade for logging systems allowing the end-user to plug-in
the desired logging system
• #3: Log4j (imported by 16.76% of top Java projects)
– Log4j is a tool to help the programmer output log statements to a variety of
output targets
• #4: Google Guava (imported by 15.6% of top Java projects)
– Google Guava is a set of common libraries for Java, mainly developed by
Google engineers
• #5: apache-commons (imported by 12.63% of of top Java projects)
– Commons Proper is dedicated to one principal goal: creating and
maintaining reusable Java components

Content developed by Dartford Grammar School Computer Science Department


Useful to know: APIs

Video (YouTube) link: https://youtu.be/6STSHbdXQWI


*This is not part of the examined syllabus, but might be useful when doing the Internal Assessment

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.8
Describe the disadvantages of OOP

Content developed by Dartford Grammar School Computer Science Department


Disadvantages of OOP
A. Increased complexity for small problems
B. Unsuited to particular classes of problems

Content developed by Dartford Grammar School Computer Science Department


A. Increased complexity
• OOP typically involve more lines of code than procedural
programs.
• OOP are typically slower than procedure-based programs, as
they typically require more instructions to be executed.

Content developed by Dartford Grammar School Computer Science Department


B. Unsuited to particular problems
• There are problems that lend themselves well to functional-
programming style, logic-programming style, or procedure-
based programming style, and applying object-oriented
programming in those situations will not result in efficient
programs.
• These problems tend to small and involving only one data
source.

Example: Why make an object when using a String will do?

Content developed by Dartford Grammar School Computer Science Department


Non-OOP vs OOP

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.9
Discuss the use of programming
teams

Content developed by Dartford Grammar School Computer Science Department


Single vs Team

Is it always better work in a team?


It is every better to work alone?
Content developed by Dartford Grammar School Computer Science Department
Team vs. Individuals
A. Speed of completion
B. Information hiding to reduce module
dependencies
C. Expertise in a narrow field (e.g. testing,
documentation)

Content developed by Dartford Grammar School Computer Science Department


A. Speed to completion
• Because tasks can be completed concurrently, the
overall project can be completed in a shorter time.

Content developed by Dartford Grammar School Computer Science Department


B. Information hiding
• Because developers only need to know the name and
required parameters to use a behaviour, they can use code
without needing to understand how it functions.
• There is also a security benefit to coders not having access
to the actual data items themselves.

Content developed by Dartford Grammar School Computer Science Department


C. Expertise in narrow fields
• Assembling a complex project needs many different skills.
• By allowing each part to be programmed by an expert in that
field, the quality of the final product is significantly higher
than expecting one person to be a ‘jack-of-all-trades’.

Content developed by Dartford Grammar School Computer Science Department


Warning!
When collaborating across international frontiers, a
common “language” needs to be developed when
resolving problems.

Content developed by Dartford Grammar School Computer Science Department


Features of OOP
IB Computer Science

Content developed by
Dartford Grammar School
Computer Science Department
HL Topics 1-7, D1-4

1: System design 2: Computer 3: Networks 4: Computational


Organisation thinking

5: Abstract data 6: Resource 7: Control D: OOP


structures management

Content developed by Dartford Grammar School Computer Science Department


1: System design

HL & SL D.2 Overview 2: Computer


Organisation

D.2 Features of OOP


3: Networks
D.2.1 Define the term encapsulation
D.2.2 Define the term inheritance
D.2.3 Define the term polymorphism 4: Computational
D.2.4 Explain the advantages of encapsulation thinking
D.2.5 Explain the advantages of inheritance
D.2.6 Explain the advantages of polymorphism 5: Abstract data
structures
D.2.7 Describe the advantages of libraries of objects
D.2.8 Describe the disadvantages of OOP
D.2.9 Discuss the use of programming teams 6: Resource
management
D.2.10 Explain the advantages of modularity in program development

7: Control

D: OOP

Content developed by Dartford Grammar School Computer Science Department


Topic D.2.10
Explain the advantages of modularity
in program development

Content developed by Dartford Grammar School Computer Science Department


Advantages
A. Easier debugging and testing
B. Speedier completion
C. Code blocks reusable

Content developed by Dartford Grammar School Computer Science Department


A. Easier debugging and testing
• By having smaller modules to test, it is easier to find and fix
bugs
• The number of tests that have to be run to confirm that
module is fully operational is also drastically reduced
according to the number of functions in a particular module

Content developed by Dartford Grammar School Computer Science Department


B. Speedier completion
• By breaking the project into smaller modules, you could save
time by finding modules that already exist in libraries that do
the function you are looking for.
• By splitting the task into different modules, each module can
be worked on concurrently (except for particular
circumstances) thus leading to a speedier completion of the
overall project

Content developed by Dartford Grammar School Computer Science Department


C. Reusable code blocks
• Some problems/functions are very common and possibly
occur in multiple different programs (for example the need
to make a text box or a clickable button to start a task)
• By reusing blocks of code, the development time is slashed
and the project is completed sooner.

Content developed by Dartford Grammar School Computer Science Department


Classic example: Javax Swing

Content developed by Dartford Grammar School Computer Science Department

You might also like