Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
1
IBM Software Group
®
Raising the Level of Development:Models, Architectures, ProgramsDr. James RumbaughIBM Distinguished Engineer
IBM Software Group | Rational software
Why Is Software Difficult?
Business domain and computer have different conceptsApplications require lots of details Code requires internal coordinationLots of repetitious code
2
IBM Software Group | Rational software
Bridging the Gap
AlignDomain specific language at the top
Abstract Several layers of models with increasing detail
ArchitectSystematic organization for internal details
AutomateUse tools to generate code
IBM Software Group | Rational software
Code-Only Development
Deceptively simpleLack of planning leads to trouble
Weak architectureBad decompositionInconsistent formats and interactionsBad for teamworkLots of detailed workBrittle for changes
3
IBM Software Group | Rational software
Model Driven Architecture (MDA)
Build high-level modelsExpressed in domain concepts
Generate platform-specific codeInto specified architectures
Using automated toolsBased on standards
IBM Software Group | Rational software
MDA Approach
Object Management Group (OMG) initiativePlatform Independent Model (PIM)
Captures logic of the application
Implementation profilePlatformTechnology decisions
Platform Specific Models (PSM)Target multiple platformsTranslator incorporates platform knowledge
PIM
PSM
Code
4
IBM Software Group | Rational software
Needed for MDA
Problem domain modelsUML or domain-specific language (DSL)
Architecture frameworksMake assumptions about infrastructureUse them to remove details from models
Automated toolsModeling toolsRepositoriesTranslators
IBM Software Group | Rational software
Needed for MDA
Problem domain modelsArchitecture frameworksAutomated tools
5
IBM Software Group | Rational software
UML
Build models in UML (Unified Modeling Language)Higher level than programming languagesAdapt UML to application domains with profiles
Special domain concepts Constraints on the use of general UML constructs
UML is still a general-purpose languageMay be a lot of repetitious details
IBM Software Group | Rational software
Domain Specific Language (DSL)
Syntax and semantics for a particular purposeReduce conceptual gap
Capture business-level contentMore intuitive syntax
Reduce mindless repetitionPredefined control and data patternsEliminate repetitious control specificationGenerate low-level details
6
IBM Software Group | Rational software
DSL Examples
yaccUnix compiler-compiler
GUI BuilderVisually construct user interface
Desktop publishing editor (FrameMaker, Word)See the final output while editing
MIDIMusic specification language
MathematicaMathematics notation
IBM Software Group | Rational software
SDL
Specification and Description Language (SDL)International Telecommunications Union (ITU) standardSpecial syntax and logic for telephone systemsSDL concepts added to UML 2.0SDL can be modeled as a UML profile
7
IBM Software Group | Rational software
DSL Styles
DeclarativeSay what to doAvoid control logic
ImperativeSay how to do itExplicit control logic
HybridHigh-level declarativeLow-level imperative
IBM Software Group | Rational software
Aspect Oriented Programming (AOP)
Separate different functional aspectsDistinct syntax for each aspectAspects cut across implementation codeExamples: Security, persistence, concurrency, logging
Translator weaves aspects into codexxxxxxx
yyyyyyy
zzzzzzz
aaaaaa
bbbbbb
cccccc
mmmmm
nnnnnnn
ooooooo
xxxxxxx
aaaaaa
mmmmm
yyyyyyy
bbbbbb
Cccccc
nnnnnnn
Ooooooo
Zzzzzzz
8
IBM Software Group | Rational software
AOP is a Kind of DSL
DSL and AOP depend on good translatorsCurrent AOP languages are awkward
Too much explicit coordination
Expect AOP features from DSL effort
IBM Software Group | Rational software
Needed for MDA
Problem domain modelsArchitecture frameworksAutomated tools
9
IBM Software Group | Rational software
Architecture
Decomposition into subsystemsTopologyInteraction rulesData formatsResource management Hooks for future extensionsScaffolding for testing
IBM Software Group | Rational software
Architecture Framework
Framework = reusable architecture patternIncludes:
Skeleton execution environmentPredefined subsystems and topologyInteraction and data rules, formats, interfacesAttachment points for plug-insComponent libraries of useful functionalitySample applications
Implementation development environments (IDE)Eclipse, .NET, J2EE
10
IBM Software Group | Rational software
Framework Advantages
Enable DSL to eliminate repeated patternsEnsure consistencyExcellent for incremental designEnforce design trade-offs
IBM Software Group | Rational software
Specifying Frameworks
UML modelsStructure modelsInteraction modelsInterface modelsPatterns
DSL syntaxCodeText descriptions
11
IBM Software Group | Rational software
Other Experience-Based Content
PatternsSolution to a common problemParametersDesign, modeling, architecture levelHas structure, interaction rules, trade-offs, guidelines
ComponentsModule ready to plug inHas UML models, code, text descriptions, keywords
IBM Software Group | Rational software
Needed for MDA
Problem domain modelsArchitecture frameworksAutomated tools
12
IBM Software Group | Rational software
Modeling Tools
Build modelsEdit modelsApply patternsOrganize large modelsCoordinate among large teamsCheck for errors and bottlenecks
Generate codeLoad technology and architecture assumptionsTrace generated code to model
IBM Software Group | Rational software
Repositories
Standard formatSupport multiple tools and languagesAccess and update modelsMOF (Meta-Object Protocol)XML (Extended Markup Language)
13
IBM Software Group | Rational software
Translation
Map from DSL and UML to codeUse platform knowledgeOptimize codeReformat to match target languageQuery-View-Transformation (QVT) project to define standard format
IBM Software Group | Rational software
Translator Requirements
Understand source and target syntaxGenerated code must be efficient enough
Plenty of experience building good compilers
Support programming language plug-insLots of existing codeHandle unexpected situations
IncrementalMaintain traceabilitySmall change to source small change to target
14
IBM Software Group | Rational software
Transformation Styles
PartialFullEmbedded code in modelBuilt-up transformation
IBM Software Group | Rational software
Partial Transformation
Transform source to codeImplementation details are missingUsually only data structures and code outlines
Then edit the code manuallyGets code stared quicklyFinish the job by programming
Round-trip transformation possibleMaintain traceability linksReverse transformation often ambiguousDifficult to maintain synchronization
Quick way to start using models
15
IBM Software Group | Rational software
Full Generation
One-way transformation from source to codeGenerate code with all detailsDon’t touch the generated codeHave to anticipate all details in the DSL
CompilerFormat conversion
UML-to-XML
Good in tightly defined situations
IBM Software Group | Rational software
Embedded Code in Model
Embed code fragments in the modelWhen DSL is inadequate
Generate code from modelInsert embedded code into generated code
Edit the source model to make changesRegenerate code when neededKeeps the entire specification together
Flexible but mixes levelstransitionT1 () {
ctr = a--;
send (a, b);
}
void methodA () {
return (a + b);
}
16
IBM Software Group | Rational software
Built-up Transformation
Explicitly model the transformation itselfAssemble out of smaller pieces
Adjust the transformation to change the resultDesign = building a transformation
Source model doesn’t changeReuse on many source models
Can have multiple transformationsPowerful but tricky to build
IBM Software Group | Rational software
One-way and Two-way Transformation
One-way—generate source to targetCan’t modify target codeCan insert plug-ins to codeNo synchronization problemsCan add and modify nested code without regeneration
Two-way—round trip engineeringMaintain traceability linksModify source or targetPropagate changes to other modelMuch more difficult to implement
17
IBM Software Group | Rational software
Executable Models
Allow execution with partial specificationDummy functionsMissing dataUnknown decisions
Incomplete models execute with less detailMay require user guidance
Test architecture earlyAdd detail later
IBM Software Group | Rational software
Executable UML
Plain UML is not executablePick action language (built-in actions too primitive)Select semantic variation pointsSupply missing execution semantics
• Tasking, external formats
It is still a general-purpose languageDSLs may be more expressive for most purposes
It may be a useful intermediate formatOutput of DSL mappingsInput to code/platform mappings
18
IBM Software Group | Rational software
Standards
ModelsArchitecture frameworksCode plug-insEncourage an ecology of vendors
Big vendors: Large generic toolsSmall vendors: Niche-specific plug-insUse plug-ins with generic toolsStandards guarantee access to entire marketExample: Photoshop filters
IBM Software Group | Rational software
Status
MDA is still earlyDSLs are still rare but comingGeneric frameworks exist
Domain frameworks will be developed
Transformation technology under developmentQVT standardMuch existing compiler experience
MDA will greatly improve software development
19
IBM Software Group | Rational software