state diagrams & file system

Upload: monil-gandhi

Post on 09-Apr-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 State Diagrams & File System

    1/33

    1

    Terms and ConceptsTerms and Concepts

  • 8/8/2019 State Diagrams & File System

    2/33

    2

    Terms and ConceptsTerms and Concepts

    AdvancedAdvanced StatesStates andand TransitionsTransitions HistoryHistory StatesStates -- AllowsAllows anan objectobject toto rememberremember whichwhich

    substatesubstate waswas lastlast activeactive whenwhen thethe containingcontaining statestatewaswas exitedexited..

    UponUpon rere--entryentry toto thethe containingcontaining state,state, thethe substatesubstate thatthatwaswas lastlast activeactive willwill bebe rere--enteredentered directlydirectly..

  • 8/8/2019 State Diagrams & File System

    3/33

    3

    History State ExampleHistory State Example

  • 8/8/2019 State Diagrams & File System

    4/33

    4

    History State RestrictionsHistory State Restrictions TransitionsTransitions maymay onlyonly enterenter aa historyhistory statestate fromfrom

    outsideoutside thethe compositecomposite statestate

    IndicatesIndicates thethe defaultdefault reenteredreentered statestate ifif thethecompositecomposite statestate hashas notnot yetyet beenbeen enteredentered

    HistoryHistory statesstates maymay notnot havehave internalinternaltransitions,transitions, nestednested compartments,compartments, etcetc..

  • 8/8/2019 State Diagrams & File System

    5/33

    5

    Terms and ConceptsTerms and Concepts

    AdvancedAdvanced StatesStates andand TransitionsTransitions

    ConcurrentConcurrent SubstatesSubstates -- UsedUsed whenwhen twotwo orormoremore statestate diagramsdiagrams areare executingexecutingconcurrentlyconcurrently withinwithin aa singlesingle objectobject..

    AllowsAllows anan objectobject toto bebe inin multiplemultiple statesstatessimultaneouslysimultaneously..

    TheThe concurrentconcurrent statestate diagramsdiagrams withinwithin aacontainingcontaining statestate mustmust beginbegin andand endend executionexecution

    simultaneouslysimultaneously..

    IfIf oneone concurrentconcurrent statestate diagramdiagram finishesfinishes first,first, ititmustmust waitwait forfor thethe othersothers toto completecomplete beforebefore exitingexitingthethe containingcontaining statestate..

  • 8/8/2019 State Diagrams & File System

    6/33

    6

    Terms and ConceptsTerms and Concepts

  • 8/8/2019 State Diagrams & File System

    7/33

    7

    Concurrent Composite StatesConcurrent Composite States

    TheThe regionsregions inin aa concurrentconcurrent compositecomposite statestatenestednested statestate compartmentcompartment containcontain statestatediagramsdiagrams thatthat executeexecute inin parallelparallel..

    OneOne statestate inin eacheach regionregion isis enteredentered whenwhen thetheconcurrentconcurrent compositecomposite statestate isis enteredentered..

    OneOne statestate fromfrom eacheach regionregion isis alwaysalways amongamongthethe jointjoint concurrentconcurrent statesstates untiluntil thethe concurrentconcurrentcompositecomposite statestate isis exitedexited..

    EventsEvents causecause transitionstransitions inin eacheach concurrentconcurrentregionregion toto occuroccur simultaneouslysimultaneously..

  • 8/8/2019 State Diagrams & File System

    8/33

    8

    Concurrent Composite State ExampleConcurrent Composite State Example

  • 8/8/2019 State Diagrams & File System

    9/33

    9

    Entering Concurrent Composite StatesEntering Concurrent Composite States

    MakeMake aa transitiontransition toto thethe concurrentconcurrent compositecomposite statestateboundaryboundary

    TheThe initialinitial statestate inin eacheach regionregion becomesbecomes thethe currentcurrent statestate MakeMake aa transitiontransition toto individualindividual statesstates inin differentdifferent

    regionsregions MainMain transitiontransition goesgoes toto aa forkfork barbar

    TransitionsTransitions toto individualindividual statestate comecome fromfrom thethe forkfork barbar AA regionregion withoutwithout aa statestate targetedtargeted byby aa transitiontransition beginsbegins

    inin itsits initialinitial statestate

  • 8/8/2019 State Diagrams & File System

    10/33

    10

    Entering Selected Concurrent StatesEntering Selected Concurrent States

  • 8/8/2019 State Diagrams & File System

    11/33

    11

    Leaving Concurrent Composite StatesLeaving Concurrent Composite States

    MakeMake aa transitiontransition fromfrom thethe concurrentconcurrent compositecompositestatestate boundaryboundary

    ForFor aa nonnon--completioncompletion transition,transition, a

    llall

    concurrentconcurrent subsub--statesstates areare exitedexited immediatelyimmediately

    ForFor aa completioncompletion transition,transition, thethe currentcurrent statestate mustmust bebeaa finalfinal statestate inin everyevery concurrentconcurrent regionregion

    M

    akeM

    ake aa transitiontransition fromfrom oneone oror moremore concurrentconcurrentsubsub--statesstates

    CoordinatedCoordinated transitionstransitions cancan gogo toto aa joinjoin barbar

    AllAll otherother subsub--statesstates areare exitedexited immediatelyimmediately

  • 8/8/2019 State Diagrams & File System

    12/33

    12

    Leaving Selected Concurrent StatesLeaving Selected Concurrent States

  • 8/8/2019 State Diagrams & File System

    13/33

    13

    ConcurrentConcurrent

    StateStateDiagramsDiagrams

    Using OMTUsing OMT

    NotationNotation

  • 8/8/2019 State Diagrams & File System

    14/33

    14

    State Diagram for a Phone LineState Diagram for a Phone Line

  • 8/8/2019 State Diagrams & File System

    15/33

    15

    Event TraceEvent Tracefor an ATMfor an ATM

    TransactionTransaction

  • 8/8/2019 State Diagrams & File System

    16/33

    16

    State Diagrams ATM, Bank, and ConsortiumState Diagrams ATM, Bank, and Consortium

  • 8/8/2019 State Diagrams & File System

    17/33

    File TypesFile Types

  • 8/8/2019 State Diagrams & File System

    18/33

    18

    FilesFiles

    FileFile isis aa co

    llectionco

    llection ofof re

    latedrelated recordsrecords inin whichwhich eacheachrecordrecord containscontains relatedrelated datadata fieldsfields..

    FileFile isis composedcomposed ofof recordsrecords andand fieldsfields..

    RecordRecord isis collectioncollection ofof relatedrelated datadata itemsitems..

    FieldField isis aa namename givengiven toto eacheach datadata itemitem containedcontained ininaa recordrecord..

    TypesTypes ofof FileFile::

    1.1. MasterMaster FileFile

    2.2. TransactionTransaction FileFile3.3. HistoryHistory FileFile

    4.4. SortSort FileFile

    5.5. BackupBackup FileFile

  • 8/8/2019 State Diagrams & File System

    19/33

    19

    Types Of FilesTypes Of Files1.1. MasterMaster FileFile:: ItIt includesincludes datadata ofof permanentpermanent naturenature..

    EmployeeEmployee salarysalary file,inventoryfile,inventory filefile andand customercustomer filesfilesareare mastermaster filesfiles..

    2.2. TransactionTransaction FileFile:: ItIt isis temporarytemporary filefile usedused totoupdateupdate mastermaster filefile..

    3.3. HistoryHistory FileFile:: ThisThis filefile cancan bebe createdcreated forfor longlong--termtermstoragestorage..

    4.4. ReportReport FileFile:: AA filefile ofof informationinformation onon auxiliaryauxiliarymagneticmagnetic tapetape oror diskdisk..

    5.5. SortSort FileFile:: AA filefile havinghaving oneone oror moremore fieldsfields inin somesomesortedsorted orderorder..6.6. BackupBackup FileFile:: AA copycopy ofof filefile toto ensureensure thatthat datadata areare

    notnotlostlost ifif thethe originaloriginal filefile isis lostlost oror damageddamaged..

  • 8/8/2019 State Diagrams & File System

    20/33

    20

    Master Fi

    le

    Master Fi

    le

    AA collectioncollection ofof recordsrecords pertainingpertaining toto oneone ofofthethe mainmain subjectssubjects ofof anan informationinformation system,system,suchsuch asas customers,customers, employees,employees, productsproducts andand

    vendorsvendors.. MasterMaster filesfiles containcontain descriptivedescriptive data,data, suchsuch asas

    namename andand address,address, asas wellwell asas summarysummaryinformation,information, suchsuch asas amountamount duedue andand yearyear--toto--

    datedate salessales.. AA filefile thatthat isis relativelyrelatively permanentpermanent andand usuallyusually

    updatedupdated periodicallyperiodically..

  • 8/8/2019 State Diagrams & File System

    21/33

    21

    Transaction FileTransaction File

    AA collectioncollection ofof transactiontransaction recordsrecords..

    TheThe datadata inin transactiontransaction filesfiles isis usedused totoupdateupdate thethe mastermaster files,files, whichwhich containcontain thethedatadata aboutabout thethe subjectssubjects ofof thetheorganizationorganization..

    TransactionTransaction filesfiles alsoalso serveserve asas auditaudit trailstrailsandand historyhistory forfor thethe organizationorganization..

  • 8/8/2019 State Diagrams & File System

    22/33

    22

    Report File and Backup Fi

    leReport Fi

    le and Backup Fi

    le

    ReportReport FileFile AA filefile thatthat describesdescribes howhow aa reportreport isis printedprinted..

    BackupBackup FileFile AA computercomputer filefile dedicateddedicated toto storingstoring andand

    updatingupdating computercomputer backupsbackups..

    TheThe branchbranch ofof engineeringengineering sciencescience thatthatstudiesstudies (with(with thethe aidaid of of computers)computers)computablecomputable processesprocesses andand structuresstructures..

    ReportReport FileFile isis aa filefile maintainedmaintained inin computercomputer--readablereadable formform..

  • 8/8/2019 State Diagrams & File System

    23/33

    23

    Table Fi

    leTab

    le Fi

    le

    AA TABLETABLE filefile hashas aa simplesimple structurestructure.. ThereThereareare threethree kindskinds ofof recordsrecords::

    COMMENTCOMMENT LINESLINES beginbegin withwith thethe charactercharacter '#''#'andand areare ignoredignored..

    BLANKBLANKLINESLINES areare ignored,ignored, butbut couldcould bebe usedusedbyby aa particularparticular programprogram toto indicateindicate somesome

    intendingintending groupinggrouping oror separationseparation ofof recordsrecords.. COORDINATECOORDINATE LINESLINES eacheach containcontain oneone setset ofof

    pointpoint coordinatescoordinates..

  • 8/8/2019 State Diagrams & File System

    24/33

    24

    Files Management SystemFiles Management System ItIt isis thethe simplestsimplest typetype ofof programprogram usedused toto managemanage

    thethe filesfiles.. TheThe softwaresoftware thatthat managesmanages thethe storage,storage, accessaccess to,to,

    retrievalretrieval fromfrom andand useuse ofof flatflat filesfiles isis calledcalled FileFileManagementManagement SystemSystem (FMS)(FMS)..

    AA flatflat filefile isis aa filefile thatthat hashas nono relationshiprelationship withwith anyany

    otherother filefile..AdvantagesAdvantages::

    LowLow purchasepurchase priceprice EaseEase ofof operationoperation andand maintenancemaintenance LowLow vulnerabilityvulnerability toto datadata errorserrors..

    DisadvantagesDisadvantages:: FlatFlat filesfiles areare independentindependent andand areare notnot integratedintegrated.. TheThe samesame datadata areare oftenoften duplicatedduplicated inin multiplemultiple filesfiles.. ProgramsPrograms toto managemanage datadata inin multiplemultiple flatflat filesfiles atat thethe

    damedame timetime areare difficultdifficult toto createcreate andand maintainmaintain..

  • 8/8/2019 State Diagrams & File System

    25/33

    25

    Database ProcessingDatabase Processing DatabaseDatabase isis collectioncollection ofof relatedrelated andand crosscross

    referencedreferenced datadata designeddesigned andand createdcreated totominimizeminimize repetitionsrepetitions andand easeease manipulationmanipulationofof datadata..

    HowHow datadata isis storedstored inin databasesdatabases:: TheThe datadata isis storedstored inin databasesdatabases inin oneone ofof

    thethe threethree typestypes ofof datadata structuresstructures::1.1. FilesFiles

    2.2. TablesTables3.3. ObjectsObjects

  • 8/8/2019 State Diagrams & File System

    26/33

    26

    DatabasesDatabasesAdvantagesAdvantages:: DataData redundancyredundancy reducedreduced DataData integrityintegrity improvedimproved DataData independenceindependence maintainedmaintained DataData securitysecurity improvedimproved

    DataData consistencyconsistency maintainedmaintained MoreMore powerfulpowerful manipulationmanipulation ofof datadata allowedallowed EasierEasier datadata accessaccess andand useuse

    DisadvantagesDisadvantages:: HighlyHighly complexcomplex andand requirerequire specializedspecialized programmersprogrammers.. ExpensiveExpensive inin termsterms ofof hardwarehardware andand softwaresoftware MassiveMassive destructiondestruction toto datadata cancan occuroccur ifif thethe securitysecurity collapsecollapse..

  • 8/8/2019 State Diagrams & File System

    27/33

    27

    Database ManagementDatabase Management

    System(DBMS)System(DBMS) ItIt isis softwaresoftware thatthat managesmanages thethe creation,creation, storage,storage,

    access,access, updating,updating, deletiondeletion andand useuse ofof databasedatabase.. AADBMSDBMS hashas thethe followingfollowing featuresfeatures::

    1.1. CreatesCreates databasedatabase byby usingusing informationinformation providedprovided bybythethe designersdesigners2.2. ItIt providesprovides programsprograms toto access,access, modifymodify andand

    manipulatemanipulate datadata inin databasedatabase..3.3. GenerationGeneration ofof reportreport..

    4.4. SecuritySecurity forfor databasedatabase5.5. ReportsReports toto managementmanagement thatthat whowho accessedaccessed

    databasedatabase andand whatwhat activityactivity waswas performedperformed..6.6. AutomaticAutomatic backupbackup forfor datadata..

  • 8/8/2019 State Diagrams & File System

    28/33

    28

    Kinds of DBMSKinds of DBMS

    1.1. SingleSingle--useruser systemsystem withwith singlesingle applicationapplicationdatabasedatabase

    2.2. SingleSingle--useruser systemsystem withwith multiplemultiple applicationapplicationdatabasedatabase

    3.3. MultipleMultiple--useruser systemsystem withwith singlesingle applicationapplicationdatabasedatabase

    4.4. MultipleMultiple--useruser systemsystem withwith multiplemultipleapplicationapplication databasedatabase..

  • 8/8/2019 State Diagrams & File System

    29/33

    29

    Database ModelsDatabase Models 44 typestypes ofof databasedatabase modelsmodels::

    1.1. HierarchicalHierarchical ModelModel2.2. NetworkNetwork ModelModel3.3. RelationalRelational ModelModel

    4.4. ObjectObject--orientedoriented ModelModel

  • 8/8/2019 State Diagrams & File System

    30/33

  • 8/8/2019 State Diagrams & File System

    31/33

    31

    2. NetworkM

    odel

    2. NetworkM

    odel

    SimilarSimilar toto HierarchicalHierarchical modelmodelexceptexcept thatthat eacheach recordrecord cancanhavehave moremore thanthan oneone parentparentthusthus creatingcreating manymany toto manymany

    relationshiprelationship inin thethe recordsrecords.. MainMain advantageadvantage ofof networknetwork

    databasedatabase isis thethe abilityability totohandlehandle sophisticatedsophisticatedrelationshiprelationship amongamong variousvariousrecordsrecords.. thereforetherefore moremore thanthanoneone pathpath cancan leadlead toto desireddesiredlevellevel..

    DataData accessaccess isis fastfast..

  • 8/8/2019 State Diagrams & File System

    32/33

    32

    3. RelationalModel3. RelationalModel

    ComposedComposed ofof manymany tablestables inin whichwhich datadata areare storedstored.. TablesTables havehave uniqueunique rowsrows andand thethe cellcell hashas singlesingle

    valuevalue.. AA databasedatabase managementmanagement systemsystem thatthat allowsallows thethe

    datadata toto readilyreadily created,created, maintainedmaintained andand manipulatedmanipulatedandand retrievedretrieved fromfrom relationalrelational databasedatabase isis calledcalledRelationalRelational DatabaseDatabase ManagementManagement SystemSystem

    DatabaseDatabase QueryQuery LanguageLanguage isis helpfulhelpful tooltool thatthat actsacts asasanan interfaceinterface betweenbetween usersusers andand RDBMSRDBMS..

    22 basicbasic queryquery stylesstyles inin re

    lationa

    lre

    lationa

    ldatabasedatabase::1.1. QueryQuery byby exampleexample

    2.2. StructuredStructured QueryQuery LanguageLanguage

    HighHigh costcost

  • 8/8/2019 State Diagrams & File System

    33/33

    33

    4. Object4. Object--Oriented ModelOriented Model ItIt usesuses objectsobjects andand messagesmessages toto

    accommodateaccommodate newnew typestypes ofof datadata andandprovideprovide forfor advanceadvance datadata handlinghandling..

    AA systemsystem thatthat allowsallows objectsobjects toto create,create,manipulate,manipulate, maintainedmaintained andand retrievedretrievedfromfrom anan objectobject--orientedoriented databasedatabase isiscalledcalled Object Object--orientedoriented databasedatabasemanagementmanagement systemsystem (OODBMS)(OODBMS)..

    ItIt isis usedused forfor applicationsapplications whichwhich areareusingusing complexcomplex datadata..