ISM 50 - Business Information SystemsLecture 13Instructor: John MusacchioUC Santa CruzNov 4, 2010Announcements2nd Folio Article due today nRead qMesserschmitt Ch 11.1 - 11.2 (325-335)qMesserschmitt Ch 15.1 - 15.2 (415-425)Student TalksArchitecture ExampleExample Concept:ArchitecturenHow do you begin to architect a solution for a problem like this?nBreak it into modules!ArchitectureAirline DataserverHEADQUARTERSHHCHHC ServerAirlineIntranetWireless LinkHHC ArchitectureWhen a module is composed of sub-modules, the architecture is hierarchical. HHC ApplicationPalm OSNetworking InfrastructureUser InterfaceCoordinationWith HHC ServerData ManagementHHC ArchitectureWe are using a layered architecture as well. nAllows reuse of previously built infrastructure.HHC ApplicationPalm OSNetworking InfrastructureUser InterfaceCommunicationWith HHC Serverdata managementGranularity tradeoff.nHow big should we make the modulesqMany simple small onesqOr a few complicated big onesnThis aspect of modularity is called granularity.nWhich is better?HHC ServernAgain, we see layering and hierarchy.nBetween each module we specify an interfaceNetworking InfrastructureWindows OSHHC Server ApplicationCommunicationwith airlinedatabaseComputationof key statisticsCommunicationwith HHCStandard Database queries (SQL) relayed to DBMS via OS and infrastructureData serverDatabaseDBMSStandard Database queries (SQL) from HHC ServerOur architecture makes use of theExisting interface of the airline database,so we dont need to redesign it!A simple interface: from within our HHC Server ArchitecureHHC ApplicationPalm OSNetworking InfrastructureComputationof key statisticsCommunicationwith HHCCommunicationwith airlinedatabaseComputationof key statisticsCompute Mean andVarianceMean,VarianceList of numbersInterfacesInterface specifications are often made precise by using data types.nExample type: floatqA number with a decimal placeqHas a certain allowable range, and precision.Computationof key statisticsN numbers ofFloat type2 Numbers of float type that signify:Mean, VarianceCompute Mean andVarianceMore on Data typesnData passing an interface is often specified in terms of a limited number of standard data typesnData type = range of values and allowable manipulationnData type does not presume a specific representation, to allow heterogeneous platformsqRepresentation must be known when data passes a specific module interfaceExample data typesIntegerqnatural number between -32,767 and +32,768qCould be represented (in many ways) by 16 bitsqsince 2n = 65,536Floatqnumber of the form m*10n/32768, where m is in the range -32,767 to +32,768 and n is in the range -255 to +256qCould be represented by 16+8 = 24 bitsMore data typesCharacterqvalues assuming a-z and A-Z plus space and punctuation marksqcould be represented by 7 or 8 bitsCharacter stringqcollection of n characters, where n is customizableqcould be represented by 7*n bitsCompound data typesProgrammer-defined composition of basic data typesExample:Employee {String name;String address;Integer year_of birth;etc.}InterfacesComputationof key statisticsN numbers ofFloat type2 Numbers of float type that signify:Mean, VarianceCompute Mean andVarianceINTERFACEPARAMETERSRETURNSImplementationComputationof key statisticsCompute Mean andVarianceImplementation 1:Xi, i=1..NMEAN,VARIANCEnOne module should not be concerned with other modules implementationq Separation of concerns.nOne module should see the other only through its interface implementation details hidden.q AbstractionModule AModule BHIDDEN From Module A!!ImplementationComputationof key statisticsCompute Mean andVarianceImplementation 2:Xi, i=1..NMEAN,VARIANCEnThough different, this implementation is ok too.nWe can choose the implementation details however we want, as long as we comply with the agreed interface.Module AModule BImplementationComputationof key statisticsCompute Mean andVarianceImplementation 1:Xi, i=1..NMEAN,VARIANCEnShould he use it?qNO!!!! Why??nEither A should compute SUM himself, or sit down with B and redesign the interfaceModule AModule BI need to get the sum,Ill just take it from BEncapsulationnThe designer of B might take measures to hide SUM from A so that A is not able to violate the agreed interface.qExample: B does not declare SUM as a global variable.nMaking a modules implementation details inaccessible to other modules is called encapsulation.InterfacesComputationof key statisticsN numbers ofFloat type2 Numbers of float type that signify:Mean, VarianceCompute Mean andVarianceINTERFACEPARAMETERSRETURNSnThis simple interface example allows for only one action of module B. qAction is Compute mean and variance.nOther examples are possible.Module BModule APossible software interfaceaction-1action-2action-3...Menu of actionsAction 1: Compute meanAction 2: Compute varianceAction 3: Compute modeEtc..Example:ProtocolIn addition to atomic actions, an interface may define protocolsqProtocol == finite sequence of actions required to achieve a higher level functionqOne action can be shared by multiple protocolsqMultiple modules may participate in a protocolProtocol ExampleHHC ServerHHCHello: Im the gate 32 serverHello: Im the HHC of Airplane#1234Tell me about the passengers of my next flight(Might be passedAs an array of a compound data type passenger, which in turn is composed of standard types like integer, and string)Return PassengerDataPassengers notedThese were the unrulypassengers on last flightAnother Interface Example: Automatic teller machine (ATM)What is the interface between this machine and the customer?Click to edit Master text stylesqSecond levelqThird levelnFourth levelqFifth levelStepsDefine available actionsDefine, for each higher level function, a protocolqSingle action or a finite sequence of actionsInterface building blocksMessage on screen or printedqMenu of actions or returns from an actionqTouch selection of actionKeypadqInput parameters to an actionCard readerqAuthentication, input parametersMoney output slotqReturns moneyAction: authenticationParametersqIdentity (card in slot)qInstitution (card in slot)qPIN (typed on keypad)Internally, it contacts institution and matches against its database, institution noted for all subsequent actions (example of state)ReturnsqScreen message (Invalid PIN or menu of available actions)Action: specify_accountParametersqAccount
View Full Document