Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.

Slides:



Advertisements
Similar presentations
Copyright © 2001 Qusay H. Mahmoud JavaBeans An introduction to component-based development in general Introduction to JavaBeans – Java components – client-side.
Advertisements

Component Oriented Programming 1 Chapter 2 Theory of Components.
L3:CSC © Dr. Basheer M. Nasef Lecture #3 By Dr. Basheer M. Nasef.
ITEC200 – Week03 Inheritance and Class Hierarchies.
Programming with Objects: Class Libraries and Reusable Code.
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
Object Oriented System Development with VB .NET
Software Testing and Quality Assurance
Component and Deployment Diagrams
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Page 1 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Chapter 4 Component Models and Technology.
Introduction to Classes and Objects CS-2303, C-Term Introduction to Classes and Objects CS-2303 System Programming Concepts (Slides include materials.
1 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2002] January 26, 2006.
Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement.
Introducing JavaBeans Identify the features of a JavaBean Create and add a bean to an application Manipulate bean properties using accessor and mutator.
Java Beans Component Technology Integrated, Visual Development Environments Reusable Platform-Independent Modular.
Ranga Rodrigo. Class is central to object oriented programming.
Chapter 12 Microsoft Assemblies. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed Design.
Introduction to Object-oriented Programming CSIS 3701: Advanced Object Oriented Programming.
Programming Languages and Paradigms Object-Oriented Programming.
Chapter 2 Object Orientation. Process Phase Affected by This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed Design.
An Object-Oriented Approach to Programming Logic and Design
Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency.
SWE 316: Software Design and Architecture Objectives Lecture # 19 Java Beans SWE 316: Software Design and Architecture  Understand  what JavaBeans (“Beans”)
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
JavaScript, Fourth Edition
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
CIS 644 Aug. 25, 1999 tour of Java. First … about the media lectures… we are experimenting with the media format please give feedback.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Your First Java Application Chapter 2. 2 Program Concepts Modern object-oriented programs help us build models to manage the complexity found in a problem.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 8 Objects and Classes.
Comparing JavaBeans and OSGi Towards an Integration of Two Complementary Component Models HUMBERTO CERVANTES JEAN-MARIE FAVRE 09/02.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Advanced Object- Oriented Programming Programming Right from the Start with Visual Basic.NET 1/e 14.
Java Programming: Advanced Topics 1 JavaBeans Chapter 8.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 05. Review Software design methods Design Paradigms Typical Design Trade-offs.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
Java Bean Definition “A Java Bean is a reusable software component that can be manipulated visually in a builder tool.”
Copyright © 2014 by John Wiley & Sons. All rights reserved.1 Chapter 10 - Interfaces.
Implementation Diagrams
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Chapter 5 Introduction to Defining Classes
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 32. Review Behavioral Patterns – Observer Pattern – Chain of command.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 15. Review Interaction-Oriented Software Architectures – MVC.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Chapter 7 Creational Design Pattern. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
Lecture 1 Introduction. © 2006 Pearson Addison-Wesley. All rights reserved 1-2 Your world is filled with objects. Many of these objects are controlled.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
R R R CSE870: UML Component Diagrams Implementation Diagrams.
Forms Concepts Triggers Fired when Internal/External events occur
Creating and Using Classes
Your First Java Application
More Model Elements.
Chapter 7 –Implementation Issues
Java Programming: Advanced Topics
Introduction to Classes and Objects
Presentation transcript:

Chapter 10 Introduction to Components

Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed Design x Key:= secondary emphasis x = main emphasis Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Learning Goals for This Chapter  … benefits of components  … what components consist of  … how they are developed  … how they are combined o with each other o with applications  … how components can be executed Understand … Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Design Goal At Work:  Reusability  We want to re-use collections of software. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Building With and Without Components Without components With components: Parts replaceable without significant rebuilding This affected by window change etc. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  What is a Component?  -- a software collection used without alteration. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Components Can Be Made of …  … Source code o Classes -- one or more, possibly related  … Executable code o Object code o Virtual object code  … Other files o Images, text, indices, etc. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

The Controlled Juggler Application

BeanBox Environment

Selecting Juggler

 Juggler is a class – actually an Applet, so it implements the Serializable interface  We do not alter (the code for) Juggler  BeanBox recognizes that Juggler is a Component, and displays an image of an instance.  Juggler listens for several kinds of events  BeanBox recognizes that Juggler implements the Runnable interface, and automatically executes its run()  Juggler operates by displaying images from the array images of type Image[]. The key lines in run() are Image img = images[ ( loop % 4 ) + 1 ]; … g.drawImage( img, 0, 0, this ); Observations on Juggler Source Code 1 Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

 rate is a private variable: A public method is available to set it as follows. public void setAnimationRate( int x ) { rate = x; } BeanBox recognizes animationRate as an int property, and allows it to be set.  Juggler code distinguishes the behavior of the bean between “design time,” “run time” etc. For example /* * If switching to runtime, … * If switching to design time and debugging is true, …. */ public void setDesignTime( boolean dmode ) ….. Observations on Juggler Source Code 2 Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Design Goal At Work:  Reusability  We want to construct and re-use a Juggler instance connected to Start / Stop buttons. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Causing ExplicitButton Press to call stopJuggling() on Juggler

Design Goal At Work:  Reusability  We want the functionality and event sensitivity of a Bean to be available in any context. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

What Components Provide The Parts of a Component  Properties  Methods o in the form of methods, published in interfaces  Reactions to Events  Ability to provide information about themselves  Set of classes providing interfaces  Manifest See below Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Manifests  Identification of the component  Authorship of the component  List of files or classes making up this component  Other components on which this one relies  Encryption information  Means of verifying that all parts of the component are present  Version number Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Introspection: Runtime Java Information Includes … Class Name, superclass, super-interfaces, inner classes, fields, constructors, Mmethods FieldName, type ConstructorParameters, exceptions MethodName, parameters, return type, exceptions Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  The Aspects of a Component  -- properties, functionality, sensitivity to events, a manifest listing its files, and an interface providing a self-description. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

UML Notation for Components components interfaces supported Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Phases of a Component’s Lifetime Assembly Time* Deployment Time Execution Time x x Design / Implementation Time Instance Creation Time* instance application executable Collection of classes; manifest * Performed in a development environment e.g., BeanBox Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Design Phase for Components  Write source code for classes o Ensure that the runtime environment contains library classes required o Conform with required rules, if any (e.g., Java Beans)  Incorporate required non-library classes  Create a manifest listing the component’s parts Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Instance Creation Time Compiled collection of classes component instance Component environment Storage component Create instanceStore instance Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Assembly Time Components Related instances Instance creation and connection Storage Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Deployment Time Compiled classes of the application component Execution environment Storage Complete application Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  The Lifecycle of a Component:  Select, design, code source, instantiate, combine instances, deploy in applications, execute. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Components in CORBA Have “Ports”  Facets (functionality provided for clients)  Receptacles (functionality it requires) Dependence on other components  Event sources (that it’s sensitive to)  Event sinks (that it listens for on other components)  Attributes (properties) Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Ports facets attributes event sink event source receptacles (“Methods”) (“Properties”) (“Events”) Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Component May Support Interfaces Interface DepositTransactions {... }; Used in … Component Bank supports DepositTransactions { … Provide additional parts as desired … }; Specification of an interface (a list of function prototypes) Specification of a component Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Finding CORBA Components and Creating Instances Get reference to component XYBank using the CORBA naming service. (Not covered here.) Create instances in two steps. (1): Use create() on the component Org.omg.Components.ComponentBase myXYBankInstance = XYBank.create(); (2): Cast the instance as XYBank object XYBank bank = (XYBank) myXYBankInstance; Now use bank... Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Summary: Components …  … are software elements used without alteration  … allow the re-use of compiled parts o Interaction via events reduces interdependence  … typically developed in a convenient container o e.g., for visualizing and interconnecting o to free the developer from common tasks  … consist of classes, files etc. and a manifest Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.