




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
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)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 項目質(zhì)保期合同協(xié)議書
- 計算機二級JAVA多線程處理的常見問題試題及答案
- 林地轉租合同協(xié)議書范本
- Access實操能力考察試題及答案
- 2025年計算機二級JAVA設計思路分享試題及答案
- 社會工作者-社會工作綜合能力(中級)真題庫-6
- 合作分成協(xié)議書合同模板
- 2025年計算機VFP考試應試攻略試題及答案
- 合同調(diào)解協(xié)議書模板下載
- 需求變化對測試計劃的影響試題及答案
- 2025年中國低溫等離子體環(huán)境消毒機市場調(diào)查研究報告
- 2025法語DELFA15級閱讀理解試卷及答案
- 2025年絕緣紙原紙行業(yè)深度研究報告
- 直擊要點2025年入團考試試題及答案
- 基于AI的管道防腐監(jiān)測系統(tǒng)研究與應用-洞察闡釋
- 酒店賓館裝修合同協(xié)議書
- 2025-2030年中國腰果酚行業(yè)競爭格局展望及投資前景研究報告
- 2025年天津市高三高考模擬英語試卷試題(含答案詳解)
- 2024年四川巴中事業(yè)單位招聘考試真題答案解析
- 以好家風涵養(yǎng)好作風-新時代領導干部家風建設專題課件
- 2025年甘肅省武威第二十中學生物七年級下冊新人教版期中模擬練習題(含答案)
評論
0/150
提交評論