GRASP:???????? - PowerPoint PPT Presentation

1 / 49
About This Presentation
Title:

GRASP:????????

Description:

Title: Introduction to GRASP Author: zhangtiange Last modified by: ztiange Created Date: 4/6/2005 2:08:24 PM Document presentation format: (4:3) – PowerPoint PPT presentation

Number of Views:129
Avg rating:3.0/5.0
Slides: 50
Provided by: zhang188
Category:
Tags: grasp | grasp | patterns

less

Transcript and Presenter's Notes

Title: GRASP:????????


1
GRASP????????
2
??
  • ???????????5?GRASP?????

3
UML?????
  • ????????????????????????(???UML???????)?
  • ??GRAPS???GoF?????????????

4
?????????
  • ??????????????????,??????????,??????????
  • ????(Classifier)???????
  • ?????
  • ??(doing)
  • ??(knowing)

5
?????????
  • ????
  • ?????????,????????
  • ????????
  • ?????????????
  • ????
  • ??????????
  • ????????
  • ???????????????

6
GRASP
  • General Responsibility Assignment Software
    Patterns
  • ??????OO???????
  • ???????????,??????,???,?????????????

7
???GRASP?UML??????
  • ??????????????????????????????

8
?????(pattern)
  • ?????????,??????????????????
  • ???????
  • ??
  • ??
  • ????
  • ???????,????????(??)???????
  • ?????????????,??????,???????????????????

9
???????
10
???
  • ??
  • ???????,?????????,??????
  • ????
  • ????????????????

11
???(cont)
  • ?????
  • ????????????????????????????
  • ??????????????????
  • ????????
  • ?????????
  • ???????
  • ????

12
??? Example
  • ????????Payment???,?????Sale?????????????

Payment
Register
Sale
13
??? Example (cont)
makePayment()
1create()
Register
pPayment
Sale
2addPayment(p)
makePayment()
1makePayment()
Register
Sale
1.1create()
Payment
14
??? Discussion
  • ??????????????????,??????????????
  • ????????????,?????????

15
??? Discussion (cont)
  • ???????????????????
  • ????????????????????????
  • ???,??????????????????????????????,???????????
  • ???????????,?????????????????????????????
  • ????????????????????????????

16
??? Discussion (cont)
  • ??
  • ???????????
  • ??????
  • ????
  • ????????

17
????????
  • TypeX ?TypeY???
  • TypeX??TypeY???
  • TypeX????????TypeY,??????,??,???????TypeY????
  • TypeX? TypeY???.
  • TypeY???,TypeA??????

18
?????
  • ???????????????????.??,J2EE???????????Java?(java.u
    til)??,??Java???????????

19
???
  • ??
  • ?????????????????????,?????????
  • ????
  • ??????????????
  • ??????????????????
  • ????????????????,??????
  • ????
  • ????
  • ????
  • ?????????

20
??(???)
21
??(???)
22
?????????
  • ?????????????????????????????
  • ????????????????????????
  • ??????????????????????,????????????
  • ?????????????????,?????????????,??????????

23
????????
  • ???????????

24
??????????
  • ?????????????????,?????????????????
  • ?????????????

25
??
  • ??????????????
  • ??????????
  • ???????
  • ?????

26
???
  • ????????????????
  • ????????????????,????A?????????B
  • B?????A
  • B??A???????

27
?????
  • ????????
  • ?????????????????????Sale?Payment
  • ????????,??????????????????????

28
???
  • ???????????????,????????????????(?????)??
  • ??
  • ?????
  • ????
  • ???
  • ?????????
  • ??-??(????)

29
???? (Information Expert)
  • ??
  • ????????????????
  • ????
  • ??????????,??????????????

30
???? (Information Expert)
  • ???????,?????????????

Sale
date time
Contains
ProductDescription
description price UPC
1..
SalesLineItem
quantity
Described-by

31
???? (Information Expert)
  • ?????????????
  • SalesLineItem ? Sale??.??????SalesLineItem ??????
  • ??Sale?????
  • ?????

32
???? (Information Expert)(cont)
  • ?????SalesLineItem????
  • ????? SalesLineItem.quantity ????ProductSpecifica
    tion.price
  • ????????,???SalesLineItem????SalesLineItem???

? ??
Sale ??????
SalesLineItem ??????
ProductSpecification ??????
33
???? (Information Expert)(cont)
34
???? (Information Expert) ??
  • ?????????????
  • DIY Do It Yourself

35
???? (Information Expert) ??
  • ??????
  • ?????????????????
  • ?????,????????,?????
  • ??????????????
  • ??????????????,????????????
  • ???????

36
???? (Information Expert)??
  • ?????,????????????,???????????
  • ??,????Sale??DB?

37
???
  • ??
  • ????????????
  • ????
  • ?????????????
  • ?????????? ???
  • ????????,??????????????? (use-case controller)
  • ?????????????????????????
  • ?????UI???????

38
???(cont)
  • ????
  • ???????????
  • ??????UI??,???Window/View??????UI??UI?????????????
    ?,???????????
  • ????????

39
????
40
????
41
??? Example
  • ?????????(???????),?????????,??? System???
  • ??,????????????System??????
  • ???????????????????????????

System
endSale() enterItem() makePayment() ..
42
??? Example (cont)
  • ????????????

???????? Register
????????? ProcessSaleHandler
  • ???????????
  • ??
  • ??

43
??? Example (cont)
????????????????????
44
??????Façade Controller
  • ??????
  • ? Register, RetailInformationSystem, Switch,
    Router, NetworkInterfaceCard etc.
  • ???????
  • ?????????

45
??????Use Case Controller
  • ??????????????????????????
  • ???
  • ??????????????????(????????)
  • ???????????????

46
??
public class EnterItemAction extends
Action public ActionForward execute(
ActionMapping mapping,
ActionForm
form...) Repository repository
..... Register register repository.getRegiste
r() String txtId ((SaleForm)form).getItemI
D() String txtQty ((SaleForm)form).getQuantit
y() ItemID id Transformer.toItemID(txtID)
int qty Transformer.toInt(txtQty) regis
ter.enterItem(id,qty)
47
?????
  • ????????????????
  • ??????????????
  • ?????????
  • ?????????????????

48
??? ??
  • ?????? (windows, applets)??????????????
  • ??????????????

onEnterItem()
onEnterItem()
SaleJFrame
SaleJFrame
1enterItem()
1makeLineItem()
2makeLineItem()
Register
Sale
Sale
49
????
  • ????
  • ????
  • ?
  • ???
Write a Comment
User Comments (0)
About PowerShow.com