Introduction to Components

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Unified Modeling Language
Introduction To System Analysis and Design
The Architecture Design Process
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Course Instructor: Aisha Azeem
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
C++ fundamentals.
Introduction to Object-oriented programming and software development Lecture 1.
A Hybrid Decomposition Scheme for Building Scientific Workflows Wei Lu Indiana University.
An Introduction to Software Architecture
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CCA Common Component Architecture CCA Forum Tutorial Working Group Components for Scientific.
Introduction To System Analysis and Design
SIAM Computational Science and Engineering1 10 February Components for Scientific Computing: An Introduction David E. Bernholdt Computer Science.
CCA Common Component Architecture CCA Forum Tutorial Working Group Introduction to Components.
SE: CHAPTER 7 Writing The Program
Component Technology. Challenges Facing the Software Industry Today’s applications are large & complex – time consuming to develop, difficult and costly.
Grid Computing Research Lab SUNY Binghamton 1 XCAT-C++: A High Performance Distributed CCA Framework Madhu Govindaraju.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
SCIRun and SPA integration status Steven G. Parker Ayla Khan Oscar Barney.
Component Oriented Programming 1 Introduction to COP.
Basic Concepts of Component- Based Software Development (CBSD) Model-Based Programming and Verification.
CCA Common Component Architecture CCA Forum Tutorial Working Group Welcome to the Common Component Architecture Tutorial.
CCA Common Component Architecture CCA Forum Tutorial Working Group An Overview of Components.
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
1 Craig Rasmussen Advanced Computing Laboratory Los Alamos National Laboratory Introduction to Object- and Component-Oriented Programming.
Introduction to business component technologies. Component definitions Szyperski: A software component is a unit of composition with contractually specified.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
CCA Common Component Architecture CCA Forum Tutorial Working Group Common Component Architecture.
CCA Common Component Architecture CCA Forum Tutorial Working Group A Simple CCA Component.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Component Object Model(COM)
Copyright © Jim Fawcett Spring 2017
Design Patterns: MORE Examples
CompSci 280 S Introduction to Software Development
Programming paradigms
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Chapter 1 Introduction to Computers, Programs, and Java
Object-Oriented Analysis and Design
SOFTWARE DESIGN AND ARCHITECTURE
Systems Analysis and Design With UML 2
The Object-Oriented Thought Process Chapter 1
Unified Modeling Language
Data Abstraction: The Walls
Complexity Time: 2 Hours.
Chapter 1 Data Abstraction: The Walls
Creating Objects & String Class
Hierarchical Architecture
Lecture 2 of Computer Science II
The Object-Oriented Thought Process Chapter 08
Chapter 1 Object-Oriented Analysis and Design. Disclaimer Slides come from a variety of sources: –Craig Larman-developed slides; author of this classic.
SVTRAININGS. SVTRAININGS Python Overview  Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed.
Subprograms and Programmer Defined Data Type
CBSE 2014 Modeling Components with UML
Functions, Procedures, and Abstraction
CSSSPEC6 SOFTWARE DEVELOPMENT WITH QUALITY ASSURANCE
CSSSPEC6 SOFTWARE DEVELOPMENT WITH QUALITY ASSURANCE
Component--based development
Programming 1 (CS112) Dr. Mohamed Mostafa Zayed 1.
Service Oriented Architecture (SOA)
An Introduction to Software Architecture
Chapter 7 –Implementation Issues
Introduction to SOA and Web Services
COMPONENT – BASED SOFTWARE ENGINEERING MODULE 2 – SECOND SEMESTER MKHIZE, BSC HONS COMPUTER SCIENCES, DIP IT, ICDL.
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
From Use Cases to Implementation
Information system analysis and design
Presentation transcript:

Introduction to Components

Overview Why do we need components? What are components? Intro to Components Overview Why do we need components? What are components? How do we make components?

Why Components In “Components, The Movie” Complexity Intro to Components Why Components In “Components, The Movie” Interoperability across multiple languages Interoperability across multiple platforms Incremental evolution of large legacy systems (esp. w/ multiple 3rd party software) Complexity The movie answers why components with … - Evolution -> adaptability, potential for growth We look more closely at another reason, complexity, also briefly touched on in the movie

Intro to Components Why Components A physician, a civil engineer, and a computer scientist were arguing about what was the oldest profession in the world. The physician remarked, “Well, in the Bible, it says that God created Eve from a rib taken out of Adam. This clearly required surgery, and so I can rightly claim that mine is the oldest profession in the world.” The civil engineer interrupted, and said, “But even earlier in the book of Genesis, it states that God created the order of the heavens and the earth out of the chaos. This was the first and certainly the most spectacular application of civil engineering. Therefore, fair doctor, you are wrong: mine is the oldest profession in the world.” The computer scientist leaned back in her chair, smiled, and then said confidently, “Ah, but who do you think created the chaos?” The task of the software development team is to engineer the illusion of simplicity [Booch].

Software Complexity Software crisis Can’t escape it Intro to Components Software Complexity Software crisis “Our failure to master the complexity of software results in projects that are late, over budget, and deficient in their stated requirements.” [Booch] Can’t escape it “The complexity of software is an essential property, not an accidental one.” [Brooks] Help is on the way… “A complex system that works is invariably found to have evolved from a simple system that worked… A complex system designed from scratch never works and cannot be patched up to make it work.” [Gall] “Intracomponent linkages are generally stronger than intercomponent linkages.” [Simon] “Frequently, complexity takes the form of a hierarchy.” [Courtois] Help is on the way.. - Building blocks (“A complex system that works…” ) - encapsulation (“Intracomponent linkages…”) - CCA components high in the hierarchy food chain (“Frequently, complexity …”)

The Good the Bad and the Ugly Intro to Components The Good the Bad and the Ugly An example of what can lead to a crisis in software: At least 41 different Fast Fourier Transform (FFT) libraries: see, http://www.fftw.org/benchfft/doc/ffts.html Many (if not all) have different interfaces different procedure names and different input and output parameters SUBROUTINE FOUR1(DATA, NN, ISIGN) Replaces DATA by its discrete Fourier transform (if ISIGN is input as 1) or replaces DATA by NN times its inverse discrete Fourier transform (if ISIGN is input as -1). DATA is a complex array of length NN or, equivalently, a real array of length 2*NN. NN MUST be an integer power of 2 (this is not checked for!). The major problem is with 41 different and poorly specified interfaces which do roughly the same thing. Work arounds exist but better interfaces needed. A component architecture would allow a usercomponent to query an FFT provider and select the most appropriate/fastest port.

Components Promote Reuse Intro to Components Components Promote Reuse X Hero programmer producing single-purpose, monolithic, tightly-coupled parallel codes Components promote software reuse “The best software is code you don’t have to write” [Steve Jobs] Reuse, through cost amortization increases software quality thoroughly tested code highly optimized code improved support for multiple platforms developer team specialization Components help solve complexity, they also encourage reuse.

What Are Components Why do we need components? What are components? Intro to Components What Are Components Why do we need components? What are components? How do we make components?

What Are Components [Szyperski] Intro to Components What Are Components [Szyperski] A component is a binary unit of independent deployment well separated from other components fences make good neighbors can be deployed independently A component is a unit of third-party composition is composable (even by physicists) comes with clear specifications of what it requires and provides interacts with its environment through well-defined interfaces A component has no persistent state temporary state set only through well-defined interfaces throw away that dependence on global data (common blocks) Similar to Java packages and Fortran 90 modules (with a little help) Independent of what (other components) Independence leads to the ability to compose Global data -> across components NOT ok, but ok within

What Does This Mean So what does this mean Intro to Components What Does This Mean So what does this mean Components are “plug and play” Components are reusable Component applications are evolvable

Component Forms [Cheesman & Daniels] Intro to Components Component Forms [Cheesman & Daniels] Component Standard must conform to some sort of environment standard (Framework) Component Specification specification of what a component does Component Interface specification of procedure names and procedure parameters Component Implementation written in a computer language (Fortran for example) Installed Component a shared object library (.so file) Component Object services and state joined together Szyperski defines what a component is. Cheesman and Daniels prefer to state the various forms that a component takes, essentially defining a component architecture

What is a Component Architecture Intro to Components What is a Component Architecture A set of standards that allows: Multiple groups to write units of software (components) The groups to be sure that their components will work with other components written in the same architecture A framework that holds and runs the components And provides services to the components to allow them to know about and interact with other components Followup on Cheesman and Daniels specifying a component architecture. One really shouldn’t think of components alone, it is the complete environment/architecture

Intro to Components What Are Components II Components live in an environment and interact with the environment through a framework and connections with other components. Components can discover information about their environment from the framework. Components must explicitly publish what capabilities they provide. Components must explicitly publish what connections they require. Components are a runtime entity. Summarizes what a component is

Components Are Different From Objects Intro to Components Components Are Different From Objects You can build components out of object classes. (or out of Fortran procedures) But a component is more that just an object. A component only exists in the context of a Component Standard (Framework). Some people have been confused by the difference between an object and a component. This slide added to clarify the differences

Pictorial Example Consumer uses Producer provides Intro to Components Pictorial Example Consumer uses Producer provides UML diagram of components showing CCA uses and provides design pattern

Three Components Integrator integrate( ) Function evaluate( ) Intro to Components Three Components Integrator integrate( ) Function evaluate( ) RandomGenerator getRandomValue( ) Functions/ports added to UML diagram. A component can be connected to/use multiple components

How Do We Make Components Intro to Components How Do We Make Components Why do we need components? What are components? How do we make components?

Interface Declaration Intro to Components Interface Declaration Integrator integrate( ) Integrator.h Integrator.f90 class Integrator { virtual void integrate( double lowBound, double upBound, int count ) = 0; }; interface function integrate( lowBound, upBound, count ) real(kind(1.0D0)) :: lowBound, upBound integer :: count end function end interface First thing to do is to decide on functionality and design interfaces

Publish the Interface in SIDL Intro to Components Publish the Interface in SIDL Publish the interface interfaces are published in SIDL (Scientific Interface Definition Language) can’t publish in native language because of language interoperability requirement Integrator example: interface Integrator extends cca.Port { double integrate(in double lowBound, in double upBound, in int count); } Still hammering on importance of interfaces. Declare in SIDL for language interoperability Only iIntroduce notion of SIDL here, more to follow later in tutorial

F90 Integrator Interface Intro to Components F90 Integrator Interface MODULE Integrator interface ! ! Returns the result of the integration from lowBound to upBound. ! lowBound - the beginning of the integration interval ! upBound - the end of the integration interval ! count - the number of integration points function integrate(port, lowBound, upBound, count) use CCA type(CCAPort) :: port real(kind(1.0D0)) :: integrate, lowBound, upBound integer :: count end function integrate end interface END MODULE Integrator Interface declaration in Fortran “Use CCA” and “type(CCAPort) :: port” statements only used by CCA Framework, not by Fortran procedures Think of an MPI communicator CCA port totally ignored when Fortran module run outside of CCA environment So this interface works both inside and outside of CCA

F90 Program program Driver use CCA use MonteCarloIntegrator Intro to Components F90 Program program Driver use CCA use MonteCarloIntegrator type (CCAPort) :: port print *, "Integral = ", integrate(port, 0.0D0, 1.0D0, 1000) end program A traditional program outside of CCA environment. Important to point out the static binding to a particular integrator type (MonteCarloIntegrator)

C++ Abstract Integrator Class Intro to Components C++ Abstract Integrator Class /** * This abstract class declares the Integrator interface. */ class Integrator : public virtual gov::cca::port { public: virtual ~Integrator() { } * Returns the result of the integration from lowBound to upBound. * * lowBound - the beginning of the integration interval * upBound - the end of the integration interval * count - the number of integration points virtual double integrate(double lowBound, double upBound, int count) = 0; }; Integrator interface in C++. CCA brought in through inheriting from gov::cca::port

C++ Object-Oriented Program Intro to Components C++ Object-Oriented Program #include <iostream> #include ”MonteCarloIntegrator.h" int main(int argc, char* argv[]) { MonteCarloIntegrator* integrator = new MonteCarloIntegrator(); cout << “Integral = “ << integrator->integrate(0.0, 1.0, 1000) << endl; return 0; } Traditional C++ program. Again note the static/compile time binding to a particular Integrator type (MonteCarloIntegrator)

Component Program Program Component Library TrapezoidalIntegrator Intro to Components Component Program Program TrapezoidalIntegrator integrate( ) ReallyWeirdFunction evaluate( ) GaussianQuadIntegrator LinearNRandomGenerator getRandomValue( ) Component Library MonteCarloIntegrator integrate( ) LinearFunction evaluate( ) UniformRandomGenerator getRandomValue( ) One uses component composition to “write”/assemble a component program. Note that binding to a particular Integrator type (as well as Function and RandomGenerator type) is now done entirely at runtime.

Questions and Answers Is CCA similar to CORBA or COM/DCOM? Intro to Components Questions and Answers Is CCA similar to CORBA or COM/DCOM? yes, but is a component architecture oriented towards high-performance computing Is CCA for parallel or distributed computing? both, but currently only one or the other Can I use CCA today for scientific applications? yes, but it is a research project Where can I get more information? http://www.cca-forum.org/ join the CCA Forum Answers to common questions (FAQ) CORBA is not a component architecture, oriented towards distributed objects

Intro to Components Final Thought Components are reusable assets. Compared with specific solutions to specific problems, components need to be carefully generalized to enable reuse in a variety of contexts. Solving a general problem rather than a specific one takes more work. In addition, because of the variety of deployment contexts, the creation of proper documentation, test suites, tutorials, online help texts, and so on is more demanding for components than for a specialized solution. [Szyperski, p. 14] Solving a general problem rather than a particular problem is the point of reusablity. But it takes more work for the component developer. Makes life easier on users of components.

Intro to Components Bibliography Booch, G. 1994. Object-Oriented Analysis and Design with Applications. Second Editions. Santa Clara, CA: The Benjamin/Cummings Publishing Company, p. 8. Brooks, F. April 1987. No Silver Bullet: Essence and Accidents of Software Engineering. IEEE Computer vol. 20(4), p. 12. Cheesman, J. and J. Daniels. UML Components: A Simple Process for Specifying Component-Based Software. New York, NY: Addison-Wesley Courtois, P. June 1985. On Time and Space Decomposition of Complex Structures. Communications of the ACM vol 28(6), p. 596. Gall, J. 1986. Systemantics: How Systems Really Work and How They Fail. Second Edition. Ann Arbor, MI: The General Systemantics Press, p. 65. Simon, H. 1982. The Sciences of the Artificial. Cambridge, MA: The MIT Press, p. 217. Szyperski, C. 1998. Component Software: Beyond Object-Oriented Programming. New York, NY: Addison-Wesley, p. 30

Intro to Components Next: CCA Concepts