Design And Software Architecture

Transcription

Design and SoftwareArchitectureCh. 41

Outline What is designHow can a system be decomposed into modulesWhat is a module’s interfaceWhat are the main relationships among modulesSoftware design techniques and informationhiding The UML collection of design notations Design patterns Architectural stylesCh. 42

What is design? Activity that provides structure to any artifact:– Different domains: construction, mechanicalsystems, chemical systems, electrical systems– Different aspects: system design, hardwaredesign, and software design Decomposes system into parts, assignsresponsibilities, ensures that parts fit togetherto achieve a global goal Design refers to both an activity and theresult of the activityCh. 43

Two meanings of "design“activity in our context Activity that acts as a bridge betweenrequirements and the implementation of thesoftware Activity that gives a structure to the artifact– Requirements specification document must bedesigned– must be given a structure that makes iteasy to understand and evolveCh. 44

The software design activity Defined as system decomposition intomodules Produces a Software Design Document– describes system decomposition into modules Often a software architecture is producedprior to a software designCh. 45

Software architecture Shows gross structure and organization of thesystem to be defined Its description includes description of:––––Main components of a systemRationale for decomposition into its componentsRelationships among those componentsConstraints that must be respected by any designof the components Guides the development of the designCh. 46

Software architecture: an attempt tosolve the problems of large systemsSolution provided bySoftware ArchitectureProblems Human’s inability incomprehending all the detailsof a project The lack of standard softwaredesign and developmenttechniques Legacy systems maintenanceand evolution Separation of Concerns, andhigh-level view of system Design patterns, design forreuse, architectural styles Software architecture recoveryCh. 47

Software Architecture definitions A generally accepted definition:“The structure of the components of a program/system, theirinterrelationships, and principles and guidelines governingtheir design and evolution over time” [SEI 1994] However, software architecture is more than “components andconnectors”, or “major elements of a system”. It is a collection ofviews, patterns, stakeholders, and roles [SEI]. Therefore, Software architecture provides the necessary means toformalize and interpret the properties of a system.Ch. 48

Software architecture terminology Components: encapsulation of the system’scomputation– Filter, layer, client, etc. Connectors: encapsulation of interactions amongcomponents– RPC, event broadcast, pipe, etc. Styles: definition of components & connectors,their properties, and configuration constraints thatapply to all instances of a family of closely relatedsystems– Pipe/filter, implicit invocation, client/server, etc.Ch. 49

Component Diagram for ABM Meaningfulnaming forservicesInterface Correctdirection for thedependencyarrows.DependencyCh. 410

See the brief guideline on howto design Component Diagramand Statechart at the architecturallevel of a system in Lab 4 descriptionCh. 411

Important Aspects of SoftwareArchitecture Architectural Styles Architectural views Architecture Description Languages Architectural Analysis and Evaluation Architecture RecoveryCh. 412

Architectural StylesCh. 413

Sample Architectural Styles Pipe and filter: UNIX shellClient and server: distributed systemsImplicit invocation (Broker): CORBA, HP SoftBenchLayered: ISO/OSI reference modelData repository (Blackboard): modern compilers, databasesObject-oriented: AesopInterpreter: programming languagesState transition: reactive systemsMain program and procedure: traditional systemsDSSA: avionics, C2, vehicle managementCh. 414

Example: Pipes and FiltersFilterPipeCh. 415

Different Architectural StylesPipe & FilterClient & ServerImplicit Invocation (Broker)Object OrientedState TransitionLayeredBlackboardCh. 4Main Program &Procedure16

Software ArchitectureViewsCh. 417

Software Architecture views Architectural views assist engineers in understanding,developing, and communicating different aspects of asoftware system. Different groups of researchers have developed their ownset of views Two important examples: 4 1 views and Zachmanframework.Ch. 418

Software Architecture views4 1 views 4 1 View Model1) Logical: functional requirement2) Process: concurrency, distribution of system services3) Deployment: planning, monitoring, reuse4) Physical: network topology 1) Scenario: represents the sequence of system operations; it shows therelation among the elements of the 4 views: Scenarios are represented by: object-interaction diagram, sequencediagram, collaboration diagram, statecharts. Sometimes referred to as: use-case, or work flow.Ch. 419

4 1 Architectural ViewsLogical ViewDeployment ViewEnd-userScenario orUse Case ViewFunctionalityProcess ViewPhysical ViewSystem integratorsPerformanceScalabilityThroughputSystem engineeringSystem topologyCommunicationPhysicalConceptualIBM Software Group Rational SoftwareProgrammersConfiguration managementCh. 420

Scenario for telephone conversation ina PBX systemFigure shows a fragment of a scenario for the small PBX:1.2.3.4.5.The controller of Joe’s phone detects and validate the transition from on-hookto off-hook and sends a message to wake up the corresponding terminal object.The terminal allocates some resources, and tells the controller to emit some dial-tone.The controller receives digits and transmits them to the terminal.The terminal uses the numbering plan to analyze the digit flow.When a valid sequence of digits has been entered, the terminal opens a conversation.Ch. 421

Software Architecture views: Zachman’s framework(Views & Perspectives)Zachman proposes a framework of views and perspectives that allows to mapthe knowledge about the system into non-overlapping representations providedby the framework.Views categorize the knowledge about the system into manageable andunderstandable forms. They answer to questions on: What, How, WhereViews:Data viewFunction viewNetwork viewWhere theconnections exist?Question:What the softwareis made of?How the nStructure of dataData lation-EntityInput-Process-OutputCh. 4Node-Line-Node22

Zachman’s framework(views & perspectives)Perspectives:Each perspective is a system documentation that reflects the interestsof a different stakeholder in software development. General scope: (Owner & business planer)– Description of gross estimation of the product’s features Owner (Owner):– Representation of owner’s desires from the final product Designer (architect):– Translation of owner’s representation to a technical plan Developer (contractor):– Translation of designer’s plan to a feasible plan Programmer (builder):– Actual production from a feasible planCh. 423

FrameworkData viewFunction viewNetwork viewGeneral scopeList of entitiesimportantto businessList of functions thebusiness performsList of locations thebusiness perspectiveEntity-relationdiagramFunction flowdiagramLogisticnetworkData modelData flowdiagramDistributed systemarchitectureData designStructure Architect’s plan)Developer’sperspective(Contractor’s plan)Programmer’sperspectiveData description(Builder’s product)Ch. 424

Design Example: Order-Taking unit.Assembling unit.Preparation unit.Inventory unit.Management unit.(MGR)(INV)Ch. 425

Restaurant system with mixture of different viewsCh. 426

Framework of different representations of restaurant sys.Ch. 427

General Scope (Perspective)Zachman’s Framework of Viewsand PerspectivesCh. 428

Data View (General Scope)Restaurant-menu, menu-items, orders, rawmaterials, and recipes are the main data entities Each order consists of menu-items. Menu-items are selected from the restaurantmenu Each menu-item consists of raw-materialsand the recipeCh. 4Fast-food restaurant system: General Scope29 Data viewD1

Function View (General Scope) Setting-up orders from restaurant-menuHandling order paymentDistributing menu-items to be preparedAssembling orders from the prepared menu-itemsKeeping track of raw-material consumptionSetting-up different tables, prices, and recipesCh. 4Fast-food restaurant system: General Scope30 Function viewF1

Network View (General Scope)Ch. 431

Owner’s PerspectiveZachman’s Framework of Viewsand PerspectivesCh. 432

E-R diagram of the Restaurant System3Restaurant-menu, menu-item(tables), order (tables),raw-material (table), andare the main data entities3 12 243242Each order consists ofmenu-items.Menu-items are selectedfrom the restaurant-menuEach menu-item consists ofraw-materials and therecipe

Function View (Owner’s Perspective)NOT IN EXAM Setting-up orders from restaurant-menuHandling order paymentDistributing menu-items to be preparedAssembling orders from the prepared menu-itemsKeeping track of raw-material consumptionSetting-up different tables, prices, and recipesCh. 434

Network View (Owner’s Perspective)NOT IN EXAMCh. 435

Aspects of DesignCh. 436

Two important goals Design for change (Parnas)– designers tend to concentrate on current needs– special effort needed to anticipate likely changes Product families (Parnas)– think of the current system under design as amember of a program family– Design the core part of a family of systemCh. 437

Sample likely changes? (1) Algorithms– e.g., replace inefficient sorting algorithm with amore efficient one Change of data representation– e.g., from binary tree to a threaded tree (seeexample)– 17% of maintenance costs attributed to datarepresentation changes (Lientz and Swanson,1980)Ch. 438

ExampleCh. 439

Sample likely changes? (2) Change of underlying abstract machine––––new release of operating systemnew optimizing compilernew version of DBMS Change of peripheral devices Change of "social" environment– new tax regime– EURO vs national currency in EU Change due to development process– transform prototype into productCh. 440

Product families Different versions of the same system– e.g. a family of mobile phones members of the family may differ in networkstandards, end-user interaction languages, – e.g. a facility reservation system for hotels: reserve rooms, restaurant,conference space, , equipment (videobeamers, overhead projectors, ) for a university– many functionalities are similar, some are different(e.g., facilities may be free of charge or not)Ch. 441

Design goal for family Design the whole family as one system,not each individual member of thefamily separatelyCh. 442

Sequential completion:the wrong way Design first member of product family Modify existing software to get nextmember productsCh. 443

Sequential completion:a graphical lproductVersion 1Version 1343364Version 1Version 2intermediatedesignVersion 2 57Version 35Ch. 444

How to do better Anticipate definition of all family members Identify what is common to all familymembers, delay decisions that differentiateamong different members We will learn how to manage change indesignCh. 445

Module A well-defined component of a softwaresystem A part of a system that provides a set ofservices to other modules– Services are computational elements thatother modules may useCh. 446

Questions How to define the structure of amodular system? What are the desirable properties ofthat structure?Ch. 447

Modules and relations Let S be a set of modulesS {M1, M2, . . ., Mn} A binary relation r on S is a subset ofSxSthat is r S x S If Mi and Mj are in S, then: Mi, Mj r can be written as Mi r MjCh. 448

Relations Transitive closure r of rMi r Mj iffMi r Mj or Mk in S s.t. Mi r Mkand Mk r Mj(We assume our relations to be irreflexive) r is a hierarchy iff there are no twoelements Mi, Mj s.t. Mi r Mj Mj r MiCh. 449

Relations Relations can be represented as graphs A hierarchy is a DAG (directed acyclic graph)M1M1a graphM1,2M1,1M3M2a DAGM1,2,1M4MM1,3M1,2,1,15M1,2,2M2M3M4M6Ch. 4a)50b)

The USES relation A uses B– A requires the correct operation of B– A can access the services exported by B throughits interface– it is “statically” defined– A depends on B to provide its services example: A calls a routine exported by B A is a client of B; B is a server In a modular system:– r n2 where n S – High fan-in and low fan-outCh. 451

Component Diagram for ABM Meaningfulnaming forservicesInterface Correctdirection for thedependencyarrows.DependencyCh. 452

Desirable property USES should be a hierarchy: e.g., Layered Style Hierarchy makes software easier to understand– we can proceed from leaf nodes (who do not use others)upwards They make software easier to build They make software easier to testCh. 453

Hierarchy Organizes the modular structure throughlevels of abstraction Each level defines an abstract (virtual)machine for the next level (OS architecture)– level can be defined precisely Mi has level 0 if no Mj exists s.t. Mi r Mj let k be the maximum level of all nodes Mj s.t. Mi r Mj.Then Mi has level k 1Ch. 454

IS COMPONENT OF Used to describe a higher level module as constituted bya number of lower level modules A IS COMPONENT OF B– B consists of several modules, of which one is A B COMPRISES A MS,i {Mk Mk S Mk IS COMPONENT OF Mi}we say that MS,i IMPLEMENTS MiCh. 455

A graphical viewM M M8 97M5M2M3M6M1M4M1(IS COMPONENT OF)M2M3M M M8 97M5M4M6(COMPRISES)They are a hierarchyCh. 456

Product families Careful recording of (hierarchical) USESrelation and IS COMPONENT OFsupports design of program familiesCh. 457

Interface vs. implementation (1) USES and IS COMPONENT OF partially describe anarchitecture To understand the nature of USES, we need to knowwhat a used module exports through its interface The client imports the resources that are exported byits servers Modules implement the exported resources Implementation is hidden to clientsCh. 458

Interface vs. implementation (2) Clear distinction between interface andimplementation is a key design principle Supports separation of concerns– clients care about resources exported from servers– servers care about implementation Interface acts as a contract between a module andits clientsCh. 459

Interface vs. implementation (3)interface is like the tip of the icebergCh. 460

Information hiding Basis for design (i.e. module decomposition) Implementation secrets are hidden to clients They can be changed freely if the change does notaffect the interface Golden design principle– INFORMATION HIDING Try to encapsulate changeable design decisions asimplementation secrets within module implementationsCh. 461

How to design module interfaces? Example: design of an interpreter forlanguage MINI– We introduce a SYMBOL TABLE module provides operations to– CREATE an entry for a new variable– GET the value associated with a variable– PUT a new value for a given variable– the module hides the internal data structure of thesymbol table– the data structure may freely change withoutaffecting clientsCh. 462

Interface design Interface should not reveal what weexpect may change later It should not reveal unnecessary details Interface acts as a firewall preventingaccess to hidden partsCh. 463

Prototyping Once an interface is defined,implementation can be done– first quickly but inefficiently– then progressively turned into the finalversion Initial version acts as a prototype thatevolves into the final productCh. 464

More on likely changesan example Policies may be separated from mechanisms Mechanism (technique, method)– ability to suspend and resume tasks in a concurrentsystem Policy (strategy, scheduling, protocol)– how do we select the next task to resume?» different scheduling policies are available» they may be hidden to clients» they can be encapsulated as module secretsCh. 465

Design notations Notations allow designs to be described precisely They can be textual or graphic We illustrate two sample notations– TDN (Textual Design Notation)– GDN (Graphical Design Notation) We discuss the notations provided by UMLCh. 466

TDN & GDN Illustrate how a notation may help indocumenting design Illustrate what a generic notation may looklike Are representative of many proposednotations TDN inherits from modern languages, likeJava, Ada, Ch. 467

An example of TDNmodule Xuses Y, Zexports var A : integer;type B : array (1. .10) of real;procedure C ( D: in out B; E: in integer; F: in real);Here is an optional natural-language description of whatA, B, and C actually are, along with possible constraintsor properties that clients need to know; for example, wemight specify that objects of type B sent to procedure Cshould be initialized by the client and should nevercontain all zeroes.implementationIf needed, here are general comments about the rationaleof the modularization, hints on the implementation, etc.is composed of R, Tend XCh. 468

Comments in TDN May be used to specify the protocol to befollowed by the clients so that exportedservices are correctly provided. Examples of protocols:– A certain operation which does the initialization ofthe module should be called before any otheroperation– An insert operation cannot be called if the table isfullCh. 469

Example (cont.)module Ruses Yexports var K : record . . . end;type B : array (1. .10) of real;procedure C (D: in out B; E: in integer; F: in real);implementationend R.module Tuses Y, Z, Rexports var A : integer;implementationend T.Ch. 470

Benefits Notation helps describe a design precisely Design can be assessed for consistency– having defined module X, modules R and T mustbe defined eventually if not incompleteness– R, T replace X either one or both must use Y, ZCh. 471

GDN description of module XModule YModule XModuleRAModuleTBCModule Zmodule Xuses Y, Zexports var A : integer;type B : array (1. .10) of real;procedure C ( D: in out B; E: in integer; F: in real);Here is an optional natural -language description of whatA, B, and C actually are, along with possible constraintsor properties that clients need to know; for example, wemight specify that objects of type B sent to procedure Cshould be initialized by the client and should nev ercontain all zeroes.implementationIf needed, here are general comments about the rationaleof the modularization, hints on the implementation, etc.is composed of R, Tend XCh. 472

X's decompositionmodule Xuses Y, Zexports var A : integer;type B : array (1. .10) of real;procedure C ( D: in out B; E: in integer; F: in real);Here is an optional natural -language description of whatA, B, and C actually are, along with possible constraintsor properties that clients need to know; for example, wemight specify that objects of type B sent to procedure Cshould be initialized by the client and should nev ercontain all zeroes.implementationIf needed, here are general comments about the rationaleof the modularization, hints on the implementation, etc.is composed of R, Tend Xmodule Ruses Yexports var K : record . . . end;type B : array (1. .10) of real;procedure C (D: in out B; E: in integer; F: in real);implementationend R.module Tuses Y, Z, Rexports var A : integer;implementationend TCh. 4.73

Code Compilation and ExecutionSource from: http://www.technocage.com/ ray/notespage.jsp?pageName ikiq1 -- This doesn't write hello worldbegin -- My first programvar x ;var y;-- lousy indentation andSPACing while y - 5 loopvar y;read x ,y;x 2 * (3 y);end;write 5; -- Not sure why five, but okay.endegq2q3iq4nbq0qfeq5nq6dCh. 474

Code Compilation and Execution 1. Generate Tokens3. Generate SyntaxTree From Tokens2. Use grammar to parseTokens (don’t panic!)Ch. 475

Code Compilation and Execution .7. ExecuteMachine LanguageOn the computer3. Generate Syntax Tree From Tokens5. Traverse treeTo generateAssembly Program6. GenerateMachine LanguageCode for CPUAssemblerProgramLDMOVLDADDLDCh. 4A, 4EHB, AC, (addrs)A, B, C(addrs 4), A4. AttachAssemblyCode76

Example: a compilerCh. 477

Other modulesmodule MAINuses ANALYZER, CODE GENERATORexports procedure MINI (PROG: in file of char;CODE: out file of char); end MAIN -- This doesn't write hello worldbegin -- My first programvar x ;var y;-- lousy indentation andSPACing while y - 5 loopvar y;read x ,y;x 2 * (3 y);end;write 5; -- Not sure why five,but okay.end module ANALYZERuses SYMBOL TABLE, ABSTRACT TREE HANDLERexports procedure ANALYZE (SOURCE: in file of char);SOURCE is analyzed; an abstract tree is producedby using the services provided by the tree handler,and recognized entities, with their attributes, arestored in the symbol table.end ANALYZERCh. 478

Other modulesmodule CODE GENERATORuses SYMBOL TABLE, ABSTRACT TREE HANDLERexports procedure CODE (OBJECT: out file of char);The abstract tree is traversed by using theoperations exported by theABSTRACT TREE HANDLER and accessingthe information stored in the symbol tablein order to generate code in the output file. end CODE GENERATORDraw the GDN of the Compiler Program. GDN isdiscussed in the next slideCh. 479

Component Diagram: CompilerCh. 480

Example of Software Architecturehttp://www.turing.toronto.edu/ brewste/bkshelf/NOT IN EXAMCh. 481

Usage of relations in Software Engineering:Architecture of ApacheS4ModularityPrinciple:Decomposing asystem based onLow-coupling &High-cohesionRest-of-sysS1S3NOTIN EXAMS2Ch. 4Color-codedLinks represent thelevel of dependencyof a file to another fileS582

Representing thearchitecture usinggraph visualizerS1-S4S5S3(Rigi) Association-links with differentstrengths to simplify the view Viewing the locus of interactionamong entities to evaluate therecovery process rest-of-sysDifferent types of links betweenboxes:– Association-links– Entity-usage links S2NOT IN EXAMFile-level analysisFunction-levelanalysisInsight into the system beforestarting the recoveryManual recoveryCh. 483

Categories of modules Functional modules– traditional form of modularization– provide a procedural abstraction– encapsulate an algorithm e.g. sorting module, fast Fourier transformmodule, Ch. 484

Categories of modules (cont.) Libraries– a group of related procedural abstractions e.g., mathematical libraries– implemented by routines of programming languages Common pools of data– data shared by different modules e.g., configuration constants– the COMMON FORTRAN constructCh. 485

Categories of modules (cont.) Abstract objects– Objects manipulated via interface functions– Data structure hidden to clients– Example: Symbol Table Abstract data types– Many instances of abstract objects may begenerated– Example: StackCh. 486

Abstract objects: an example A calculator of expressions expressed inPolish postfix forma*(b c) abc * a module implements a stack where thevalues of operands are shifted until anoperator is encountered in the expression(assume only binary operators)Ch. 487

Example (cont.)Interface of the abstract object STACK"exports:procedure PUSH (VAL: in integer);procedure POP 2 (VAL1, VAL2: out integer);Ch. 488

Design assessment How does the design anticipate changein type of expressions to be evaluated?– e.g., it does not adapt to unary operatorsCh. 489

Abstract data types (ADTs) A stack ADT allows to have more thanone instance of a stack moduleindicates that details of thedata structure are hiddenfrom the clientsmodule STACK HANDLERexportstype STACK ?;This is an abstract data -type module; the data structureis a secret hidden in the implementation part.procedure PUSH (S: in out STACK ; VAL: in integer);procedure POP (S: in out STACK ; VAL: out integer);function EMPTY (S: in STACK) : BOOLEAN;.end STACK HANDLERCh. 490

ADTs An ADT module is a module that exports a type, along with theoperations needed to access and manipulate objects of thattype. An ADT hides the representation of the type and the algorithmsused in the operations. The details of the type is dealt with inthe implementation of the ADT. Correspond to Java and C classes Concept may also be implemented by Ada private types andModula-2 opaque types May add notational details to specify if certain built-in operationsare available by default on instance objects of the ADT– e.g., type A TYPE: ? (: , ) indicates that assignment and equality checkare available

An example:simulation of a gas stationmodule FIFO CARSuses CARSexportstype QUEUE : ? ;procedure ENQUEUE (Q: in out QUEUE ; C: in CARS);procedure DEQUEUE (Q: in out QUEUE ; C: out CARS);function IS EMPTY (Q: in QUEUE) : BOOLEAN;function LENGTH (Q: in QUEUE) : NATURAL;procedure MERGE (Q1, Q2 : in QUEUE ; Q : out QUEUE);This is an abstract data-type module representingqueues of cars, handled in a strict FIFO way;queues are not assignable or checkable for equality,since “: ” and “ ” are not exported. Module GAS-STATIONend FIFO CARSuses FIFO CARSgasoline 1, gasoline 2, gasoline 3: QUEUEcar wash: QUEUE;that car: CARS;ENQUEUE (car wash, that car);MERGE (gasoline 1,Ch. 4 gasoline 2, gasoline 3);end GAS STATION92

Example ofModular Programming Using CModular Programming in CBy John R. Hayes, Courtesy of Embedded Systems ProgrammingNov 30 2001 (8:24 AM)URL: D 9900399DEFINITION MODULE fooEXPORT list of functions andNOTdataINdeclarations of exported functionsand dataEND fooEXAMIMPLEMENTATION MODULE fooIMPORT list of modules used. code .END fooCh. 493

Listing 1: foo.c(implementation)/* foo.c *//* Import needed interfaces: */#include "x.h"#include "y.h"/* Implements this interface;NOTused forINcompilerEXAMchecks: */#include "foo.h"int var1;static int var2;void Fun1(int *p) { . }static void Fun2(void) { . }Ch. 494

Listing 2: foo.h (interface)/* foo.h */#define var1 Foo var1/* prefixing function name with module name */NOT IN EXAM#define Fun1 FooFun1extern int var1;extern void Fun1(int *);Ch. 495

Missing Proper Header File#include stdio.h main() { printf("e %f\n", exp(1)); }NOT IN EXAMMay produce e 0.0000 instead of e 2.718282Program has a simple mistake. It is missing#include math.h . The use of function prototypesprevents such a problem. C compiler assumes thatexp(1) expected and integer argument andreturned an integer result.Ch. 496

Listing 3: client.c(implementation)/* client.c *//* Import needed interfaces: */#include "z.h"/* Implements this interface: */#include "client.h"NOTstatic void ClientFun(void){int z;.Fun1(z);.}IN EXAMAn integer passed to Fun1 instead of pointer to integer.#include “foo.h” is missing. Client.c will compile but linkerCh. 4 an error message97Can not find Fun1 and will send

Listing 4: priqueue.h(interface)/* priqueue.h */#define Enqueue PriEnqueue#define Dequeue PriDequeue#define CreateQueue PriCreateQueueNOT IN EXAMtypedef struct priority queue struct * Priority queue;extern void Enqueue(Priority queue, int priority, void *data);extern void *Dequeue(Priority queue);extern Priority queue CreateQueue(void);int x;float f;void *p &x; // p points to x*(int*)p 2;p &r;// p points to r*(float*)p 1.1;Ch. 498

Modular programming consists of separating implementation frominterface and hiding information in the implementation. In C this is achieved by placing the interface definition in a header fileand the implementation in a source file. Disciplined use of static is used to hide implementation details. Theinterface definition forms the link between a module and its clients.NOT IN EXAM The module includes its own interface definition to confirm that itimplements the advertised interface; a client module imports/includesthe interface definition to verify that it is using the interface correctly. Put the constant definitions and data structure declarations in theheader for inclusion by its corresponding C source file. Now, if aconstant or data structure is only used by one source file, place themin that source file. If a constant or data type is used throughout anapplication, they belong in a traditional header file.Ch. 499

However, software architecture is more than “components and connectors”, or “major elements of a system”. It is a collection of views, patterns, stakeholders, and roles [SEI]. Therefore, Software architecture provides the necessary mea