l05- software architectures

Upload: rajendraraju

Post on 14-Jan-2016

232 views

Category:

Documents


0 download

DESCRIPTION

SDM

TRANSCRIPT

  • Software ArchitectureCS 4311

  • ArchitectureArchBeamSuspensionCable-stayedDesign at the highest levelExample: bridge architectures

  • ArchitectureArchBeamSuspensionCable-stayedDesign at the highest levelExample: bridge architecturesWhy do civil engineers talk about bridge architectures?

  • What is architecture?Dictionary definitions:archangel, archenemy, archduke, archbishopmatriarch, patriarch, monarchArch as prefix or suffix: main, chief, principal, most important, highest, fundamental, basic, extreme or most characteristic, ruler, leader

  • ArchitectureThe art and science of designing and erecting buildingsFundamental underlying design of buildingsStyle and method of design and construction of buildingsBuildings and other structures

  • What is software architecture?FrameworkMechanismWayShapeFormMeansOrganizationArrangementThe Big Picture !

  • Software Architecture the structure or structures of the systemsoftware componentsexternally visible properties of those componentsthe relationships between themthe set of principle design decisions made about a software system.

  • What design decision?System structureFunctional behaviorInteractionNonfunctional propertiesImplementationSystem goals, Stakeholders, Nontechnical considerations

  • Independent ComponentsBroadcastsClient-serverEvent drivenComponents register for an event. System invokes all registered components when event happens.Example: Java AWTDynamic, responsibility with event handler, not event generator.Can be hard to test/debug.

  • Virtual MachinesInterpreters:Program to be executedInterpreter: simulate instructions in programState: State of program, state of interpreterExamples: JVMCommand language processors

  • RepositoriesCentral Data store + operations {store, retrieve, update}Traditional: transactions trigger processingBlackboard: Central store controls processingProcesses write to central store (knowledge sources)Processes respond to changes in the store

  • Layered Architecture

    Layers are hierarchicalEach layer provides services to the outer layer which is a client to the inner layerLayers can have access to adjacent layers (direct access only)The design includes how each pair of layers interact (protocols)Layered architectures are often used for interactive information services

  • ExampleLayered security architecture

    CryptographyFile interfaceKey managementUser

  • Advantages and Drawbacks+ Each layer can be seen as a higher level of abstraction+ A change on one layer affects only layers interacting with the changed layer+ Clearly favors reuse- Layers are not always obvious when looking at the requirements- Performance may suffer from the extra coordination among the layers

  • PresentationApplicationControl andCoordinationDomainServices andInformationLegacyDatabaseServicesBrowsersWeb ServerApp ServerDb ServerLayered Architectures in Interactive Information Systems

  • PresentationApplicationServicesDomainServicesTechnicalServicesEventsResultsResultsResultsMessagesMessagesCharacteristic Object RolesInterfacersInformation holders, service providers,Structures, coordinators, and domain controllersCoordinators, and (application) controllersInterfacersWindows and Widgets

  • Locating Objects in LayersOnce we have agreed on a layered architecture, we need to identify objects (classes) in layersOne approach is to use Class-Responsibility-Collaboration -objects collaborates mostly within their layers -client objects will tend to be in an outer layer (requests go inside) -information goes outside

  • Process ControlProcess maintains setpointControl based on input variables (feedforward) Output variables (feedback)Examples: Thermostat controlled heatersmart stock trader

  • Architecture ElementsComponentsConnectorsConfiguration TopologiesModels

  • ComponentsElements that encapsulate processing and data in a systems architecture are referred to as software components.An architectural entity that encapsulates a subset of the systems functionality and/or data, restricts access to that subset via an explicitly defined interface, and had explicitly defined dependencies on its required execution context.

  • ConnectorElements that are tasked with effecting and regulating interactions among components.Application independent.

  • Configuration TopologyA set of specific associations between the components and connectors of a software systems architecture.

  • ModelsAn artifact that captures some or all of the design decisions that comprise a systems architecture.Architectural modeling is the reification and documentation of those design decisions.Different models: structural vs. behavioralstatic vs. dynamicscope

  • Architectural StylesA named collection of architectural design decisions that: are applicable in a given development context, constrain architectural design decisions that are specific to a particular system with that context, and elicit beneficial qualities in each resulting system.Not about: specific systems, components, interaction mechanisms, or configurations.

  • An Architectural Style ExamplePhysically separate the software components used to request services from the components that provide the services, to allow for proper distribution and scaling up, both in the number of service providers and service requesters.Make the service providers unaware of the requesters identity to allow the providers to service transparently many, possibly changing requestors.Insulate the requesters from one another to allow for their independent addition, removal, and modification. Make the requesters dependent only on the service providers.Allow for multiple service providers to emerge dynamically to off-load the existing providers should the demand for services increase above a given threshold.

  • Architectural StylesRemarks:Each style has its own advantages and drawbacksAn application may require several architectural viewsChoosing the right views is a key factor in having a good design

  • Advantages of Architectural StylesEach combination of styles emphasizes one or more of the quality attributes below:UsabilityAvailabilitySecurityPerformanceMaintainabilityFlexibilityPortability

  • Example Software Architectures Batch SequentialBlackboardClient ServerDatabase-centric Distributed ComputingEvent drivenInterpreterMonolithic application

    Peer-to-peerPipe and FilterPlug-inService-orientedSearch-orientedSpace-basedShared nothingThree-tier modelRule evaluation

  • Assignment:Base GroupsEach teams has until next class to prepare a 3 minute description of the provided architectureYou will present next classWhat is itWhat problem does it solveHow does it solve the problemWho are the actorsHow do they relate to each otherYou will need to be efficient to cover the architecture in 3 minutesSend Aditi 2 or 3 powerpoint slides by 5pm WednesdayINCLUDE YOUR SOURCES

  • Example Software Architectures

    Team 1 BlackboardTeam 2 InterpreterTeam 3 Plug-inTeam 4 Search-orientedTeam 5 Space-basedTeam 6 Shared nothingTeam 7 Publisher-subscriberTeam 8 Rule evaluation

  • Batch Sequential ArchitectureA series of dedicated and independent components that transforms data in a sequential manner (Each component needs to finish its task before the next one can start).

  • Batch Sequential ArchitectureSolve complex taskDivide complex tasks into several easier tasks.Modifiability/MaintainabilityEasy to change/fix the behavior of a component.ReusabilityBy only changing the components that interact with the environment the system can work on different structures.FlexibilityAdditional components are easy to integrate.

  • Batch Sequential ArchitectureActorsThe actors consist of the independent components (programs) that run in sequence to achieve the ultimate desired output of the system.Each components is responsible for a particular task and supplies the next component with the intermediate data once it has completed its task.

    How do they relate to each other?They are related to each other by the data that they each transform.

  • Batch Sequential Architecture*Example: Compiler*Software Design Methodology, By Hong Zhu 2005

  • Client-Server ArchitectureApplication context:Clients request services from a serverCentralization of computation and data at the serverSeparation of user interface tasks from computation and data management and storageFor examples: Websites, etc.

  • Client Server ArchitectureExample:

  • Database-Centric ArchitectureCritical databases applications always need a global transaction monitor.can significantly reduce performance and scalability.Architecture solves data management and processing of it. Computes all the data to a single place, in this case the database.

  • DBMSSERVER 1SERVER 2Client 1Client 2Client 3Client 4Client 5Client 6Benefits:Reduces amount of code, development time, network traffic, complexity of applications.

    Actors and their roles

  • Distributed Computing ArchitectureAlso known as grid computing.Makes use of the hardware on several computers.Primarily used to solve those problems that require exceptionally heavy computation. SETI@Home was the first project that demonstrated the feasibility of distributed computing to solve these problems.Indeed, this was one of the primary goals of [email protected] specific problem SETI@Home is used for is to detect intelligent life outside of Earth.

  • Distributed Computing ArchitectureThe software written for SETI@Home requires 2 components:Central server software manages the distribution of data across personal computers and the collection of analyzed data.Personal computer software performs analysis and monitors processor usage, ensuring that analysis is done only when the processor is not otherwise needed.

  • Event Driven ArchitectureComponents in the system react to certain events.For exampleState changesI/O eventsCreates responsiveness in a changing environmentActorsAgents: components in a system that generate eventsSinks: event consumersResponsibility of applying action as soon as event is presentMay act as a filter to another componentMay provide an action based the given event

  • Event Driven Architecture CharacteristicsFacilitates responsiveness Works great in un-normalized unpredictable environments Event flow Sensing of factTechnical representation in the form of an eventReaction(s) to set eventExampleEmail application displays a message stating that a new e-mail has been received

  • Event Driven Architecture

  • Monolithic ArchitectureSingle-Tier ArchitectureConcept of having user interface and application of data access in one single program. Only application is accountable for computationsSimplest software configurationNo modularityNot a typical Software Engineering Concept

  • Why Monolithic Architecture?Low CostLess Complex No need to develop external computational or processing modules

    Simple and Quick designSingle independent application

    No need for future expansion of softwareNot easily maintained

  • Peer-to-Peer ArchitectureA type of architecture in which each class has equivalent capabilities and responsibilitiesA class can collaborate with any other class and vice versaEvery class has access to the resources neededEvery class gives access to all its resourcesNo Super-classes

  • Peer-to-Peer ArchitectureAdvantages:Decentralized computing with flow of control and resources distributed among peers Highly robust in the face of failure Scalable in terms of access to resources and computing powerCautions: When information retrieval is time critical Security

  • Pipe and FilterThis is an architecture composed of filters and pipes:A filter is a program that reads a stream and writes a streamA pipe is middle where that directs the output stream of one program to the input stream of anotherFilterFilterFilterInput DataTransformedDataTransformedData

  • Pipe and FilterThis is an architecture composed of filters and pipes:A filter is a program that reads a stream and writes a streamA pipe is middle where that directs the output stream of one program to the input stream of anotherUseful when you have common stream processing programs that can be reusedThe cost is that a lot of I/O processing is duplicated (e.g., parsing the data)

  • Example Pipe and FilterExample: Unix shell scriptsccl1 fred.txt | ccp0 | ccp1 | ccp2 > fred.o

    | is the pipe operatorRead from the standard output of program to leftWrite to standard input of program to right

  • Pipe and FilterComponents are isolatedEasy to understand and reuse filtersEvolution is easy: replace filterAllows concurrent executionMay be easy to analyze (analyze each filter for throughput, accuracy)Batch or stream, not interactiveReplication of effort (reading, writing, parsing)

  • Service-Oriented Architecture (SOA)ProblemClient needs access to multiple features however the client shouldnt know how those features are implementedSOA:Provides access to multiple components or functions Client doesnt know what components or how functionality is implemented

  • SOASolve the ProblemProvides an interface that hides the components and gives the client a single access point.ActorsClientComponents

  • Three-Tier Architectureclient-server architectureThree different tierPresentationInput/ outputBusinessData processingData AccessRead/Write

  • Three-Tier AdvantagesHighly cohesive and lowly coupledAllows change in modules with out effect on the other tiersEncapsulates tasks

    *http://publib.boulder.ibm.com/infocenter/discover/v8r4/index.jsp?topic=/com.ibm.discovery.ds.overview.doc/c_UG_Single_Tier_Architectures.htm

    http://wiki.answers.com/Q/What_is_single-tier_architecture

    **Every class has access to the resources needed to fulfill its responsibilitiesand at the same time gives access to all of its resources to all other classes*