EEE 243B Applied Computer Programming - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

EEE 243B Applied Computer Programming

Description:

Composition: how are the various reused components going to be used in the system? ... Only need to create one copy (instance) of a server. ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 23
Provided by: tarpi
Category:

less

Transcript and Presenter's Notes

Title: EEE 243B Applied Computer Programming


1
EEE 243BApplied Computer Programming
  • Component-based software engineering

2
Review
  • Name the different kinds of software
    architectures.
  • In a layered architecture, a layer that is below
    another one, provides _________ to the above
    layer
  • If we say that a repository has an implicit locus
    of control what is meant by that?

3
Outline
  • Reuse
  • Reuse The higher levels
  • Components definition
  • Components using
  • Communicating your design
  • Reuse by level of abstraction

4
Reuse
  • When we talked about decomposition, we saw that
    one of its benefits was that we could reuse some
    parts of the solution for a given problem to
    solve a different problem.
  • Reusability is a key principle in software
    engineering, and it applies at several levels of
    abstraction

5
Reuse
  • To find the origin of reuse in the software
    engineering community, we go back to the NATO
    conference that addressed the software crisis
    (1968)
  • Recall this is where software engineering was
    first coined as an expression
  • McIlroys paper Mass-Produced Software
    Components is the first reference to high volume
    reuse of software products

6
Reuse
  • Reusability has several benefits
  • Good reuse increases the productivity of
    programmers this leads to
  • Cost reduction of projects
  • Reduced schedules
  • Well known algorithms/solutions that have been
    coded and proven can increase software quality
    and system reliability
  • Apart from cost reduction, there is a market out
    there for reusable components you could make
    money at it

7
Reuse
  • At the lowest level of the reusability continuum,
    is our ability to reuse computer language
    abstractions (if, while, switch,)
  • As we saw earlier in the course, this was the
    first attempt by computer scientists to reuse
    proven flow control mechanisms
  • Prior to high level languages, programmers had to
    use machine language or assemblers and
    consistently reproduce these mechanisms

8
Reuse
  • In lecture 8, we saw how functions were
    originally created to reuse blocks of code within
    the same program
  • Reusing a function in the program instead of
    using cut-and-paste operations to reproduce the
    block of code, allowed programmers to produce
    solutions faster and more reliably

9
Reuse
  • In reuse, modules are a step above functions,
    because you can form libraries of reusable
    modules
  • These modules can be language libraries
  • math.h, string.h, conio.h, stdio.h,
  • Modules can also be produced locally by software
    shops
  • 243_lib or my_lib
  • Libraries are a strong source of reuse in any
    high-level language

10
Reuse
  • Before we have large scale reuse of code, we must
    solve these problems
  • Searching As you must have already experienced
    or asked yourself, how are you supposed to know
    if a certain function exists or in what module it
    resides
  • Experts, books and the Web are starting points
  • Understanding Most modules on the market are
    black boxes that must be used based on a
    specification of an interface
  • sufficient information has to be available in the
    header file to provide usage, parameters, error
    messages and the like

11
Reuse
  • Adaptation tinkering with the code is often not
    an option
  • because the code/design is simply not available
    or
  • the algorithm may not be understood well enough
    to make local modifications and any changes to
    the library could have unknown side effects
  • Sometimes a wrapper can be used to change the
    interface of a module for I/O or for fault
    tolerance of black box modules (catching errors),
    but this should be the only modification made
    with a module
  • Composition how are the various reused
    components going to be used in the system?

12
Reuse The higher levels
  • The reuse continuum is not only limited to
    language constructs, blocks of code, functions,
    modules and libraries
  • When we talked about architectures, we see that
    architectural idioms can be reused from solution
    to solution
  • These architectural abstractions can also be
    combined to form hybrid architectures
  • Architectural idioms are at the highest level of
    reuse in software engineering

13
Reuse The higher levels
  • Below architectural reuse, we look at reusing
    designs
  • Several problems share common design solutions
  • Only need to create one copy (instance) of a
    server. Check if one server already exists if it
    does use it, if not create a new one.
  • Attaching many functions to listen for an event
    (implicit repositories)
  • Allowing for widgets to be created in a platform
    independent way
  • Hiding modules behind a main module (façade)
  • and several others

14
Reuse The higher levels
  • Design reuse is more mature than architectural
    reuse
  • Several books have been published on design reuse
    and are normally called design patterns or design
    principles
  • Design patterns are not language dependant, but
    they are often based on the analysis and design
    methodology/approach used to solve the problem
    (Object-oriented or structural)
  • Design patterns are normally represented with
    diagrams and pseudo code

15
Components - definition
  • Between designs and modules, we have another
    level of reuse
  • It is possible to take entire solutions that can
    stand on their own and use them as part of larger
    solutions or systems
  • The term component has often been used to
    describe small blocks of code, functions and
    modules
  • Components are in fact fully functional,
    stand-alone programs that can provide an end-use
    service

16
Components - using
  • Component reuse is closely linked to software
    architecture
  • Software architecture provides the context to
    develop and/or reuse building blocks based on
    well specified interfaces
  • For example, if we need a database (repository
    architecture) as part of a robot that is
    implemented in a layered architecture, we can
    write our own repository or get a commercially
    available component and reuse it in our system

17
Components - using
  • Several commercial products provide both an
    internal interface (user interface) and an
    external Application-Programmer Interface (API)
    that allow it to be used as part of another
    system
  • Such a product could be used on its own or
    programmed from the edge using the API
  • MS-Access
  • Visio
  • Excel
  • MySQL,
  • What is needed is a well-defined API

18
Components - using
  • The use of components in building systems is an
    emerging practice and is known as Component-Based
    Software Engineering
  • A yearly international conference is dedicated to
    this area of research International Conference
    on COTS-Based Systems - ICCBSS

19
Communicating your design
  • As you use components as part of your system you
    can use a simple component diagram to show how
    your components depend on each other
  • A component is normally indicated by the
    following icon

20
(No Transcript)
21
Spectrum of reuse
Architectural idioms
Design patterns
Components
Impact of reuse on cost and schedule
Complexity involved in reuse and specification
Libraries/modules
Functions
Language constructs
22
Quiz Time
  • Name a few benefits of reuse in software
    engineering.
  • Name the problems you encounter in reusing code.
  • What is a component?
Write a Comment
User Comments (0)
About PowerShow.com