




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
WhatisObject-Oriented?
?Objectorientationisanapproachto
softwaredevelopmentthatorganizesboth
theproblemanditssolutionasacollection
ofdiscreteobjects;
?Itisakindofrepresentationthatdescribe
object'sdatastructureandbehavior.
?Itisakindofmodelingtechnology.
Characteristicsof00Representation
?Identity-name,reference,handle
?Abstraction
?Classification
?Encapsulation
?Inheritance
?Polymorphism
?Persistence
The00DevelopmentProcess
?Beconsistencyofterminologyandof
-Theproblemandthesolutionweredescribedin
sameterms:classes,objectsmethods,attributes,and
behaviors.
?Beconsistencyofperspective
-Staticviews
-Dynamicviews
-Restrictions
TendencyforChangewhenUsing00Paradigm
(Jacobsonetal.1995)
Characteristicofsoftwareproduct/projectProbabilityforchange
ObjectsderivedfromtheapplicationLow
Long-livedinformationstructuresLow
Passiveobject5sattributeMedium
SequencesofbehaviorMedium
InterfacewiththeoutsideworldHigh
FunctionalityHigh
OORequirements
?OOrequirementsanalysisisusuallydoneintheuser's
language.
?OOrequirementsanalysisdiscussestheconceptsand
scenarioslikelyinapplicationdomain.
-Theconceptsincludeinformation,service,and
responsibilities.
-Domainknowledgeenablesbothdevelopersandusersto
understandtheproblems.
?Therequirementsdefinitioncanbeindependentof
implement.
00Design
?Requirementspecification,thefirststepsofdesign.
?Torepresentasystemdesign
-First,toidentifyandrepresentclassesandobjects.
-Second,toidentifytheinteractionsandrelationships
amongobjectsandclasses.
?Associations
?Compositions
?Aggregations
?Inheritance
?Toprovidethedetailsinprogramdesign.
-Insertcomputationalfeaturesinthemodels
-Insertsomeclasslibrarydetails
-Considernonfunctionalrequirements
UseCases(用例)
?Describeparticularfunctionalitytoexhibithow
auser,externalsystem,andotherentitydialog
withthesystem.
?Scenario場景
?Script腳本
Usecasediagrams(用例圖)
?Actor(角色)
-Aentityinteractingwiththesystem
-Orarolethatanentityplayswithrespectofthesystem
,User
?Device
,Anothersystem
?Cases(用例)
-Adepictionofsomeaspectoffunctionality
?Extensions
-Toextendausecasetoillustrateadifferentordeeper
perspective.
?Uses
-Actuallyareuseofanalready-definedusecase
Overviewofroyalservicestation
Aactoro
Standfbracase
(Billing^)
Customer\
\
(^^efiielmg^)(^^arking^JMaintenance
Firstextensiontoincludepreventivemaintenance
Secondextensiontoincludecreditcardsystem
Thirdextensiontoincludeinventoryandaccounting
FuelOrderingPartsOrdering
systemsystem
UseUMLtoRepresent00
?OMG(ObjectManagementGroup)haveadopted
UMLasthe00notationalstandard.
?UMLcanbeusedtovisualize,specify,or
documentaproblem.
?UMLcanbeusedthroughoutthesoftware
developmentprocess.
UMLdiagrams
?Staticviewisdepictedwith
-Usecases(用例圖)
-Classdiagrams(類圖)
-Packagediagrams(包圖)
-Deploymentdiagrams(酉己置圖)
?Dynamicviewisdepictedwith
-Statediagrams(狀態(tài)圖)
-Activitydiagrams(活動圖)
-Sequencediagrams(順序圖)
-Collaborationdiagrams(合作圖)
?Restrictionsandformalization
-BeexpressedwithOCL(objectconstraintlanguage)
00SystemDesign
?Fivelevelsof00design
-Identifysubjects
-Identifyclassesandobjects
-Identifyattributes
-Identifystructures
-Identifyservices
Determinecandidateclasses
?Somequestionscanhelpustogroupthe
candidateclassesandobjects.
-Whatneedstobe"processed“insomeway?
-Whatitemshavemultipleattributes?
-Whendoyouhavemorethanoneobjectinaclass?
-Whatisbasedontherequirementthemselves,not
derivedfromyourunderstandingofthe
requirements?
-Whatattributesandoperationsarealwaysapplicable
toaclassorobject?
RelatedRequirementStatements
Acustomerhastheoptiontobebilledautomaticallyatthetimeof
purchase(offuel,maintenance,orparking)ortobesentamonthly
paperbill.Ineithercase,customerscanpayusingcash,creditcard,
orpersonalcheck.RoyalServiceStationfuelissoldaccordingto
pricepergallon,dependingonwhetherthefuelisdiesel,regular,or
premium.Serviceispricedaccordingtothecostofpartsandlabor.
Parkingissoldaccordingtodaily,weekly,andmonthlyrates.The
pricesfbrfuel,maintenanceservices,parts,andparkingmayvary;
onlyManny,thestationmanager,canenterorchangeprices.Athis
discretion,Mannymaydesignateadiscountonpurchasefbra
particularcustomer;thisdiscountmayvaryfromonecustomerto
another.A5%localsalestaxapplestoallpurchase.
TentativeclassesofRoyalServiceStation
?Personalcheck?Services
?Paperbill?Discounts
?Creditcard?Tax
?Customer?Parking
?Stationmanager?Maintenance
?Purchase?Cash
?Fuel?Prices
FirstGroupingofAttributesandClasses:Stepl
ClassesAttributes
CustomerPersonalcheck
MaintenanceTax
ServicesPrice
ParkingCash
FuelCreditcard
PaperbillDiscounts
Purchase
Stationmanager
RelatedRequirementStatements
Thesystemappliesonlytoregularrepeat
customers.Aregularrepeatcustomermeansa
customersidentifiedbyname,addressandbirth-
datewhousesthestation'sserviceatleastonce
permonthfbratleastsixmonths.
Thesystemwillsendperiodicmessagesto
customers,remindingthemwhentheirvehicles
areduefbrmaintenance.Normally,maintenance
isneededeverysixmouths.
FirstGroupingofAttributesandClasses:Step2
ClassesAttributes
CustomerPersonalcheck
MaintenanceTax
ServicesPrice
ParkingCash
FuelCreditcard
PaperbillDiscounts
PurchaseBirthdate
PeriodicmessageName
StationmanagerAddress
Forthefullsetofrequirements,we
mightexpandourtabletoinclude
alloftheclasses.
FirstGroupingofAttributesandClasses:Step3
ClassesAttributes
Customer
MaintenancePersonalcheck
ServicesTax
Parking
FuelPrice
Paperbill
PurchaseCash
Periodicmessage
StationmanagerCreditcard
Warningletter
PartsDiscounts
Accounts
InventoryBirthdate
CreditcardsystemName
Part-orderingsystem
Fuel-orderingsystemAddress
IdentifyBehavior
?Lookfbrparticularitemsthatsuggestbehaviors:
(Extractverbsfromtherequirementsstatement)
-Imperativeverbs
-Passiveverbs
-Actions
-Thingsorremindedevents
-Roles
-Operatingprocedures
-Serviceprovidedbyanorganization
?Thebehaviorswillbecomeactionsor
responsibilities.
UseUMLtodescribetherelationship
amongtheobject,classes,andbehaviors
bill
Issuedate:Date
Paymentdate:Date
Price()
Taxes()
Customers()
Purchase()
Add_to_bill(customer,amount,date)
Inheritance
Fourkindsofrelationship
?Generalization
?Aggregation
?Association
?composition
UMLnotations
association
composition
aggregation
dependency
navigation
Associationofclasses
Qualifiedassociation
Qualifiedassociation
SwayBackandForth
?AbstractaMessageClassfromwarningletterand
periodicmessage.
?Thefuelclassshouldbeconnectedtoinventoryclass
?Deletetheaccountclass(hasonlyoneattribute)andadd
theaccountnumbertothecustomerclass.
?Addthreenewclass,refuel,parkingspace,service.
-Fortakingadvantageofthepolymorphism
?Thepriceanddiscountcanbedifferentdependingonwhatserviceis
required.
-Removethediscountratefromthefuelclassandputitinthe
partclass.
-Removethepricefromthefuelclassandaddittotherefuel
class.
-Putthepriceofaparkingspace,locationintheparkingclass.
CustomerPeriodic
Messages
nameWarningletter
Address
Birthdatetexttext
Purchase
dateBillStation
CreditCardManager
systemtaxrateissuedate
Paymentdate
Services
ParkingSpacepriceVehicleMaintenance
locationdiscountrateissuedate
Paymentdate
Refuel
Part
gallons£7Inventory?
ocationricepartnumber
price
Price
ParksFueldiscountrate
FuelOrderingOrdering
min_quantity=l00systemsystem
Currentquantity
SwayBackandForth
?DeleteStationManagerclass
?Addservicestationtohandlethetrackingof
dormantaccounts
OtherUMLDiagrams
?Classdescriptiontemplate
?Packagediagrams
?Sequencediagrams
?Collaborationdiagrams
?Statediagrams
?Activitydiagrams
Classdescriptiontemplate
?Templatetellus
-thepositionoftheclassintheoverallhierarchy
-exportcontrols
-cardinality
-associations
?Templatealsospecifies
-theoperationsintheclass
-thepublicinterfacetotheclass
Templatefbrtherefuelclass
Classname:refuelPublicinterface:
Category:serviceOperation:
Externaldocuments:price
Exportcontrol:PublicPrivateinterface:
Cardinality:nAttributes:
Hierarchy:Gallons
Super-classes:servicesprice
Associations:Implementation:
Operationname:priceAttributes:
Publicmemberof:refuelGallons
Documentation:price
Preconditions:Statemachine:no
Gallons>0
Objectdiagram:unspecifiedConcurrency:sequential
Semantics:Persistence:transient
final_price=gallons*price
Concurrency:sequential
Packagediagrams
Standfor
dependent
Interactiondiagrams
?Todescribehowoperationsandbehaviors
arehandledbyobjects.
?Todescribehowtheobjectsareconnected
statically.
?Basedoneachusecase
?Twokindsofinteractiondiagrams
-Sequencediagrams
-Collaborationdiagrams
Sequencediagramfbrtherefuelusecase
CustomerServiceStationCreditCardPurchaseRefuel
System
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年湖北恩施州招募“三支一扶”高校畢業(yè)生筆試真題
- 物聯(lián)網(wǎng)電力設備故障預警與預測性維護-全面剖析
- 簡單的食堂承包合同范文(18篇)
- 貴州省銅仁市2024-2025學年高三下學期第一次模擬考試生物試題(解析版)
- 跨域微服務通信機制-全面剖析
- 蔬菜高效栽培技術-全面剖析
- 靶向藥物研發(fā)-全面剖析
- 銀翹片質量控制研究-全面剖析
- 量子計算與網(wǎng)絡安全的接口-全面剖析
- 點云數(shù)據(jù)壓縮-全面剖析
- 演唱會可行性研究報告
- 2025屆河北省邢臺市名校協(xié)作高三下學期一模英語試題(含答案)
- T-BSRS 128-2024 核醫(yī)學放射性廢液快速處理技術要求
- 2025年鐵路小型養(yǎng)路機械市場分析現(xiàn)狀
- 2024內蒙古能源集團校園招聘394人筆試參考題庫附帶答案詳解
- 網(wǎng)絡安全和保密意識教育
- 《橋梁健康監(jiān)測》課件
- 企業(yè)安全生產(chǎn)“一企一冊”“一崗一冊”制度簡介
- 耳鼻喉科學第二十三章耳部疾病講解
- 未來學校建筑的現(xiàn)代設計思考與創(chuàng)新
- 一般擔保合同范例
評論
0/150
提交評論