490 likes | 635 Views
Design Mechanisms The path to successful projects. Lars Fredholm MagicIT. Bio. Lars Fredholm, System Enginer IBM, RSV, LANI, MSC, MagicIT AB C, Clipper, VO, SQL-Windows, VB/MTS, Java Rose Experience since 1993 (Rose 2.x) Today: Rational OOAD/Rose Certified Instructor, MCP
E N D
Design MechanismsThe path to successful projects Lars Fredholm MagicIT
Bio • Lars Fredholm, System Enginer • IBM, RSV, LANI, MSC, MagicIT AB • C, Clipper, VO, SQL-Windows, VB/MTS, Java • Rose Experience since 1993 (Rose 2.x) Today: • Rational OOAD/Rose Certified Instructor, MCP • Consulting in Rational’s Tools
The Architect Mind • What does it mean technically?
Architectural Mechanisms? Technical functionality that is needed GUI Stateless/ State Concurrency/Distribution Window Navigation Persistency Security Master/ Detail Broker/ Transaction Communication Devices Reporting Legacy System/ Import/Export Language/ Errors
Architectural MechanismsThree Categories • Architectural Mechanism Categories • Analysis Mechanisms (conceptual) • Design Mechanisms (concrete) • Implementation Mechanisms (actual) • Exampel • Persistence => Database => Sybase
Architectural Mechanisms have Characteristics • Persistency • Granularity: 1 to 10 Kbytes per row • Volume: up to 200000 rows • Access frequency • Create: 500 per day • Read: 2,000 access per hour • Update: 1,000 per day • Delete: 50 per day • Communication • Synchronicity • Message Size • Protocol
Parts in RUPregarding Design Mechanisms • Inception / Early Elaboration • Requirements (functional and supplementary) • Build Technical Prototypes • SAD, Software Architecture Document • Elaboration • Model Design Mechanisms • Design Guidelines • Use Case Realization • Construction • Code Templates
Inception PhaseMilestone: Can we do this project? • Functional Requirements • Use Case survey, System scope, Priority • Non functional Requirements • Technical Prototypes (prove concept) • Candidate Architecture • Architecture Mechanisms • Project Plan • Cost and schedule
Use-Case Model Functional RequirementsUse Case Model Survey • Gives Early Abstractions - Analysis Classes
Analysis Class Analysis Mechanism(s) Week Persistency, Security Project Persistency, Security Employee Persistency, Legacy Interface Company Persistency, Legacy Interface ProjectController Transaction Map to Analysis ClassesAnalysis Classes are early Classes • Mapping Mechanisms and Analysis Classes
Supplementary Specifications Non Functional Requirements Supplementary Specifications • GUI • Devices • Environment • Storage • Communication • Performance • Distribution
Technical PrototypesTechnical prototypes proves the choice of Architecture and reduces Risks early • Validate Mechanism with Prototype • If a Prototype doesnt exist, build it! • GUI applet, graphical applet • Report applet, scanner applet • Database applet, transactions applet • Object broker applet • External system applet, import/export applet • Stress applets • Security applets
Candidate ArchitectureSoftware Architecture Document • Describes the Architecture by examples • Shows Architecture significant examples of: • Use Cases • Realizations • Class Diagrams • Process Diagrams • Component Diagrams • Deployment Diagrams • Data Model
The Candidate Architecture SADSoftware Architecture Document
Elaboration PhaseMilestone: Have we managed all questions regarding the Systems architecture? • Design Mechanisms • Design Patterns to Reuse • Tested & proved technical Prototypes • Design Guidelines • Rules to follow when designing the System • Use Case Realization • Use Case Scenarios with Iteration and Class Diagrams
Design Pattern Design Mechanisms Design Mechanisms: • Design Patterns Parameterized Collaboration of components that solves a general design problem • Iteration Diagrams • Objects & Messages, Dynamic view • VOPC (View of Participating Classes) • Class Diagram, Static view • Technical Prototype • Code snippets
Design Mechanisms,Design Pattern Styles • Inheritance • Use Structural behavior from Super Class • Delegation • Use build-in behavior from Subsystem • Role Classes (templates) • Reuse same behavior as modeled in Role Classes
Security Mechanism, Code Examples 'Check Permissions for resource Public Function ChkRights(Session as clsSession, Resource as Object, Permission as Integer) As Boolean On Error GoTo Catche Dim strPerm as String Try: strPerm = Resource.ObjectPerm(Session) Select Case Permission Case 1 'Check VIEW permissions_ blnOk = Mid(strPerm,1,1) Case 2 'Check NEW permissions _ blnOk = Mid(strPerm,2,1) Case 3 'Check UPDATE permissions _ blnOk = Mid(strPerm,3,1) Case 4 'Check DELETE permissions _ blnOk = Mid(strPerm,4,1) Case Else _ blnOk=False End Select ChkRights=blnOk Exit Function Catche: Err.Raise Err.number, Err.description, Err.source, Err.helpFile End Function
Transaction Mechanism, Code snippets – Templates 'Operation on <<role>> Controller Class in Application Server Public Function Transaction() As Boolean On Error GoTo Catche Dim objCtxObj As ObjectContext Try: 'Get MTS context Object from Global AppServer Set objCtxObj = GetObjectContext() 'Inform MTS of Transaction Completion If Not objCtxObj Is Nothing Then objCtxObj.SetComplete Exit Function Catche: 'Inform MTS of Transaction Abortion If Not objCtxObj Is Nothing Then objCtxObj.SetAbort Err.Raise Err.number, Err.description, Err.source, Err.helpFile End Function
The Communication Tool Design GuidelinesHandbook for designers
Use-Case Model Design Model Use Case Use-Case Realization Use Case Realization Realization Package: • Iteration Diagrams • Dynamic View • VOPC (View of Participating Classes) • Class Diagram - Static view
Use Case Realization, Realization with Design Mechanisms • Receptionist is a person working in the Reception with Customers. • Order is received from Customer by Receptionist. The Paper is Scanned and Customer information captured by the System.
Use Case Realization, Realization with Design Mechanisms • Enter New Order is a part of the GUI Navigation Mechanism
Use Case Realization, Realization with Design Mechanisms • GUI Navigation Mechanism • Role Class PageDetail cloned to frmOrder
Use Case Realization, Realization with Design Mechanisms • Imaging Mechanism • No need to model deeper into Subsystem • Already fully modeled in Mechanisms
Use Case Realization, Realization with Design Mechanisms • Persistency Mechanism - clone clsOrder
Use Case Realization, Realization with Design Mechanisms • All Mechanisms
Use Case Realization, Long version • Without Mechanisms – a long long version
Construction PhaseMilestone: Are we ready to install? • Is it Good Quality code? • Are executables Stable and Tested? • Is System documented and mantainable? • Will User receive high usability? • Is it inside timeframe (TTM)?
Code TemplatesCode snippets with variation points • Design Mechanisms gives reusable beaviour • Resusable beaviour are code segments with variation points (Roles) • Copy boring repeating code • Focus on essential programming tasks • Reusable code already tested • Code Templates could be written
AutomationEnhanced by Design Mechanisms Code Automation: • Rose Code Generation (Stubs) • Copy & Paste programming • Code Wizards • Template Tools • Rose Reversing Code (Round Trip)
SummaryUsing Design mechanisms • Inception • Anaysis Mechanisms identifies risks early • Elaboration • Design Mechanisms reduces risks early • Design Mechanisms accelerates modeling • Construction • Templates code reduces risks early • Templates code accelerates coding • Templates code increases quality of the code
Thank You! Design MechanismsThe Vehicle to successful projectswww.magicIT.com Lars Fredholm