L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software...

26
L10 - April 12, 2006 copyright Thomas Pole 200 3-2006, all rights reserv ed 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families of Languages

Transcript of L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software...

Page 1: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

1

Lecture 10: Software Assets

and Text:Ch. 8: Language Anatomy

andCh 9: Families of Languages

Page 2: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

2

Agenda• Lecture: Reusable Software Assets• Domain Specific Languages:

– Types of Information• From Chapter 7: “Programming with Models”

– Chapter 8: Language Anatomy

– Chapter 9: Families of Languages

– Break

– Defining the Project’s DSL

• Class Project• Q&A

Page 3: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

3

Lecture: Reusable Software Assets

• Not just implementation assets– Anything that can be reused to develop a new

system• Requirements

• Design

• Implementation

• Organized and managed– By the DSL and the Reuse Driven Processes

Page 4: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

4

Software Assets

• Metadata supports each asset– Internal metadata adds useful information to each asset: how to

use it, how to integrate with it, other asset specific metadata.– External, usually contextual metadata, including cataloging and

architecture metadata.

• Packaging– Different for different asset types (e.g. requirements, design, test,

implementation)

• Packaging and metadata represent the commonality and variability of each asset.– C/V packaging of implementation assets tailor the asset to its

target systems requirements.

Page 5: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

5

C/V Mechanisms of Software Assets • C/V of Requirements

– Example: multiple choice form

• C/V of Design– Example: High level generic architecture, and rules its

detailed specialization

• C/V of Implementation– Examples:

• Reusable assets and instruction to tailor• Base classes, derived class examples, and instructions for

deriving additional new classes • Generic types and instructions to instantiate new types.

Page 6: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

6

Domain Specific Languages

• From Chapter 7: “Programming with Models”– Types of Information

• Chapter 8: Language Anatomy

• Chapter 9: Families of Languages

• Break: ---------------------

• Defining the Project DSL

Page 7: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

7

Type of Information in Programming with Models

• What the model should capture:– Qualities of service models: Performance, capabilities,

dependency, etc.: is realized by behavior…– Behavior models: what the software does, hot it

interacts with other software, how its parts work together.; is realized by structure…

– Structure models: Organization of the software, it’s composition, it’s classes/objects/modules; is realized by artifacts…

– Artifact models: describe the development, deployment and execution (operation)

Page 8: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

8

Chapter 8: Language Anatomy

• We need a formal language (e.g. TCP/IP), not a natural one (e.g. English)

• A language grammar is made up of semantics (meaning of symbols) and syntax (rules for combining semantic elements)

• Abstract Syntax: the kinds of elements that make up the language and the rules on how they can be combined.

• Semantics: the meanings of all the elements.

• Concrete Syntax: The way a language “appears”, or how it is actually used. (E.g. English is either spoken or written)

Page 9: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

9

Types of Languages

• Declarative Language: captures assertions and constraints

• Imperative Language: captures instructions to be executed.

• Most modeling languages area mix of the two.

Page 10: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

10

Capturing the Grammar

• Bachus-Naur Form (BNF) – captures rules in equation form.

• Abstract Syntax Tree (AST) - a sort of decision tree for constructing statements in a language .

• Metamodels – (used to define UML) An OO model of the abstract syntax of a langauge.

Page 11: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

11

Break• 15 minutes• Domain Specific Languages

– …

– Defining the Project DSL

• Class Project– Web Service Basics

– Assignments, review #2, assign #3• Discerning Family Members - Domain Definition

– Project Submission Guidelines

Page 12: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

12

Defining the Project DSL

• Needs of the Project DSL

• Defining a DSL

• Project DSL– Semantics– Abstract Syntax– Concrete Syntax

• The PCM Language

Page 13: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

13

Needs of the Project DSL

• DSL Specific Language (multiple dialects)– DSL in Requirements mode

• Understandable to both req. analyst and customer/user.

• Transform problem model to requirements model

– DSL in Design mode• Transform requirements model to design model

• Crosse the divide between problem space and solution space

– DSL in Implementation Mode• Transform design into implementation

• Must represent variations in engineering concepts as well as application concepts (algorithms, structures, protocols, etc.)

Page 14: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

14

Defining a DSL• Define narrative language

– Syntax: abstract and concrete

– Semantics:

• Procedures to support– How to apply language a to requirements

– How to search for assets via the language

– Tracking reusable assets from requirements through implementation according to language

– How to archive assets according to language

Page 15: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

15

Class Project

• Lab: Basic Web Services, second try

• Review Project Assignment #2: Product Line Processes

• Assign Project Assignment #3:

• Project Submission Guidelines

• Domain Definition and Discerning Family Members

Page 16: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

16

SOAPSimple Object Access Protocol

• Capture a programmatic interface using an XML variant, called SOAP.– Uses a subset of XML – Also adds to XML to represent behavior– Definition is still evolving, adding:

• Transaction processing

• Security

Page 17: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

17

Basic Web Services

• The Need: A Packaging Mechanism, and the Solution: SOAP/Web Services– Must support variability.

• Unfortunately, SOAP only supports tailoring and parameterization, but some IDE’s add inheritance and/or generics in the implementation language.

– Must support DIAE delivery• SOAP supports excellent DIAE’s loose coupling

goals.

Page 18: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

18

Class Project: Web Service Intro.

• Examples will be in Visual Studio, ASP .Net 2.0.– Visual Studio 2005– File->New->Web Site->ASP.Net Web Service– Most examples in C# (VB also okay)

Page 19: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

19

ASP.Net WebMethods (Web Services) in C#

• Server Syntax– Add a method to the Service object

• The one that inherits from: System.Web.Services.WebService

• Preface with “[WebMethod]”

• All else, we use the usual C# syntax

• Set the project as the default project, run in debugger, select the asmx file from the list that appears.

Page 20: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

20

Consuming a Web Service

• Client syntax, in C# console client– File->New->Project->Console Application

• Solution: Add to solution

– Add a web reference• Elect client project

• Menu: Project->Add Web Reference– Web Services in this Solution: Select and click “Add

Reference”

Page 21: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

21

Review Project Assignment #2Reuse Driven Processes

• Process Definitions:– Comparing new system requirements to

existing assets.– Tracing requirement specs to design assets to

implementation assets.– Capturing from a recently completed system

development effort new reusable assets, and opportunities for new reusable assets.

Page 22: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

22

Assign Project Assignment #3Product Line (Generic) Design

• Use any “ball and stick” or layered drawing technique you like.

• Show the major components, their relationships to each other and dependencies.

• Show the Commonality and Variability of the product line.

Page 23: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

23

Project Submission Guidelines• Required (all for each team member)

– Domain definition– Reuse driven process definitions– Domain Specific Language

• Optional (one or more for each team member)– Component Implementation(s)– Application Implementation

• If components are available

– Generic Design (including)• Product line generic architecture• Interface API and DPI of a major component

Page 24: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

24

Another Project Example: Collaborative Systems

• This is an old collection(s) of components, but a brand new:– Domain definition– Reuse driven processes– Generic Design

• I’ll develop this in parallel to the class project, as an example in a different domain.

Page 25: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

25

Class Project, so far• Produce a reuse driven software

development infrastructure:– Schedule (approximate)

• Domain Definition – week #1 - done

• Process definition – week #2 - done

• Generic Design - week #3 - assigned

• Reusable Assets - week #4

• Final Exam & Team Work Session - week #5

• Project Presentations - week #6

Page 26: L10 - April 12, 2006copyright Thomas Pole 2003-2006, all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.

L10 - April 12, 2006 copyright Thomas Pole 2003-2006, all rights reserved

26

Questions?

• For next week:– Read the text through chapter 8, “Language

Anatomy” for next week.– Email me your …… then 9:00 PM Monday

April 10, 2006.