0% found this document useful (0 votes)
2 views16 pages

CSC102 - Top-Down Design, Object Oriented Design-1

The document discusses two primary algorithm development methodologies: top-down design and object-oriented design. Top-down design involves breaking down a system into smaller subsystems for efficient programming, while object-oriented design focuses on encapsulation, classes, and inheritance to facilitate modular development. The evolution from procedural languages like C to object-oriented languages like Java highlights the advantages of cross-platform compatibility, ease of use, and improved memory management.
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)
2 views16 pages

CSC102 - Top-Down Design, Object Oriented Design-1

The document discusses two primary algorithm development methodologies: top-down design and object-oriented design. Top-down design involves breaking down a system into smaller subsystems for efficient programming, while object-oriented design focuses on encapsulation, classes, and inheritance to facilitate modular development. The evolution from procedural languages like C to object-oriented languages like Java highlights the advantages of cross-platform compatibility, ease of use, and improved memory management.
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/ 16

AIRFORCE INSTITUTE OF TECHNOLOGY

FACULTY OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE
ALGORITHM DEVELOPMENT METHODOLOGIES: TOP-DOWN DESIGN, OBJECT ORIENTED DESIGN
BY:
ISA, ADAM MUHAMMAD
Email: [email protected]
TOP-DOWN DESIGN, OBJECT-ORIENTED DESIGN
TOP-DOWN-DESIGN
• Top-down design is a braking down a system into small sub-system
and breaking these sub-system down into smaller sub-systems until
each sub-system performs one task.
• This is a method of breaking down a problem into smaller problems.
• Doing this allows several programmers to work on different sub-
system; thus making the design process more efficient.
TOP-DOWN-DESIGN

The traditional model for software design is called top-down. it proceeds


through these steps:
• Break down of the problem into large areas.
• Design a solution by identifying tasks, information, and presentation.
• Describe algorithms and data-structures in pseudo-code.
• Implement a program in a standard programming language
• Each level is more detailed than the previous (higher) level. as the design proceeds, it
becomes larger and more complex at each level, growing like a pyramid from top (small
end) to bottom (big end).
• The use of a traditional structured programming language like C or
Fortran means that the commands at the bottom level have little or no
relationship to the problem-domain concepts at the top levels. the
pseudocode level for algorithms and data-structures provides a transition
layer connecting the two, but the connections may be difficult to follow.
the end-user might be involved in the top two levels, but only
programmers can understand the bottom level. this disconnection between
descriptions and between people causes lots of problems.
This model was considered "natural" and standard for many years. unfortunately, it
had several significant shortcomings :
• Further development becomes more and more difficult, because the complexity
grows too rapidly at the bottom, with many small commands.
• Revision often requires reworking at all levels (cycling back from bottom to
top), which could require throwing away the old system and starting over
• The modules (pieces) are often tightly coupled (interdependent), which means
reuse is very difficult.
• The "logical distance" between the problem domain and programming
language is large - that is, the commands in the language are not directly related
to the actual problem.
OBJECT ORIENTED INNOVATIONS

In older high level languages (like C), data items, data structures, programming constructs, and
algorithms were all parts of the language. The keywords and identifiers formed a long list of
unrelated commands. This could be quite confusing, because a procedure name could look like a
variable name. From it's beginning as a development language for the Unix operating system in
the early 1970’s, C grew into a confusing collection of data type and function identifiers with
very little structure.
A decade later, it was rationalized with the creation of C++ by Bjarne Stroustrup. C++ extended
C by adding classes and objects. but it retained all of the C commands, so programs were still
complex and confusing. but the availability of classes and objects in C++ made it the preferred
language for developers in the 1980's and enabled long-term development of software projects
like Microsoft windows, Ms office, and other large, complex applications.
Between 1991 and 1995, James Gosling and a group of sun programmers created Java, which is a
"pure" object-oriented programming language. In Java everything (almost) is a class or an object.
Java's big advantages over C++ :
• Java is cross-platform, so developers can write one program and it runs on windows, Linux, the Mac,
and other platforms - this is not true for C++.
• Java has a very small set of standard keywords (under 100 compared to many hundreds for C++).
everything else is classes and objects, so programs are easier to read and modules (classes) are widely
re-usable
• Java was created with web programming facilities in mind, and is one of only a few languages with
these facilities
• Java is "safer" than C++, because it no longer contains lower level commands (like C). The memory
management in Java is automated (with automatic garbage collection), and low level pointer
commands (memory allocation and deallocation) are no longer permitted. faulty memory-
management is responsible for many of the bugs in C++ based software.
WHAT IS OBJECT ORIENTED COMPUTING?

• Most new client/server application development tools emphasize object-oriented


features. The introduction of the object-oriented approach in the 1970s marked
a radical change in the methodology and approach of large-scale application
development. "the old paradigm, algorithmic decomposition, offered a top-down
methodical approach. large and small-scale applications relied heavily on testing
and debugging to meet the required specifications.
OBJECT ORIENTED DESIGN (OOD)
• Object oriented design (OOD) fundamentally changed the way software
designers and specification writers approached the problem of efficiently
designing applications.
• OOD allows large-scale applications to be developed in independent modules.
object-oriented decomposition provides a method to decompose a complex
arrangement by the primary objects apparent in the system. “Once the objects are
defined and the system functionality is assigned, major components of the
software system are developed independently. the parallel development and
testing of individual modules requires strict adherence to the specification
interface requirements“.
ENCAPSULATION
• An object is a "black box" which receives and sends messages. a black box contains code
and data. "traditionally, code and data have been kept apart." in object oriented
programming, code and data are merged into a single indivisible thing -- an object. "a
primary rule of object-oriented programming is this: as the user of an object, you should
never need to peek inside the box (or object)".
• All communication is to be done via messages. the object to which a message is sent is
called the receiver of the message. messages define the interface to the object. everything
an object can do is represented by its message interface. therefore, an object can be used
without knowing exactly what is inside of it, and it becomes unnecessary to directly
modify the object. "providing access to an object only through its messages, while keeping
the details private is called encapsulation".
• Encapsulation is important because parts of software must sometimes be changed or re-
used.
OBJECT

• Object: all the entities involved in the solution design are


known as object. for example, person, banks, company and
customers are treated as objects. every entity. Every entity
has some attributes associated to it and has some methods on
the attributes.
CLASSES
• Class: a class is a generalized description of an object. An object is an
instance of a class. class defines all the attributes, which an object can
have and methods, which defines the functionality of the object.

• In the solution design, attributes are stored as variable and


functionalities are defined by means of methods or procedures.
INHERITANCE
• If there is already a class which can respond to many different messages, it is possible to make a
new, similar class which adds just a couple more messages without having to re-write the entire
class by creating a subclass. this new class inherits all the existing messages, and therefore, all
the behaviour of the original class. The original class is called the superclass of the new class.
• Inheritance also promotes reuse. it is not necessary to start from scratch when writing a new
program if the existing classes have similar behaviours to those needed in the new program. "for
example, after creating the class Dog, you might make a subclass called Wolf, which defines
some Wolf-specific messages, such as hunt. or it might make more sense to define a common
class called Canis, of which both Dog and Wolf are subclasses".
• There are almost two dozen major object-oriented programming languages in use today, but there
are only a few leading commercial languages. these languages are: C++, Smalltalk, and java.
THANK YOU!

You might also like