14-2 GRASP?? - PowerPoint PPT Presentation

1 / 43
About This Presentation
Title:

14-2 GRASP??

Description:

Title: ASP.NET 2.0 Author: Last modified by: hueyan Created Date: 2/8/2001 6:27:07 PM Document presentation format – PowerPoint PPT presentation

Number of Views:157
Avg rating:3.0/5.0
Slides: 44
Provided by: 6649734
Category:
Tags: grasp | larman

less

Transcript and Presenter's Notes

Title: 14-2 GRASP??


1
?14? ???????
  • 14-1 ??????????
  • 14-2 GRASP??
  • 14-3 Gang of Four????
  • 14-4 ??????

2
14-1 ??????????
  • 14-1-1 ???????
  • 14-1-2 ???????

3
14-1-1 ???????-??
  • ????????????????????????????????,?????????
  • ????(Design Patterns)?????????????????????????,??
    ????????????????????,???,???????????,?????????????
    ???????????
  • ??(Framework)?????????????????????,??????????????
    ??,?????????????,???????????,??????????????,??????
    ?????????????

4
14-1-1 ???????-??
  • ????????????,????
  • ????????????
  • ??????????,????????????
  • ???????????????,?????????????????????

5
14-1-2 ???????-??
  • ???????(Design Pattern Description)???????????????
    ?????,??????????
  • ??????????????,??,?????????????????????????

6
14-1-2 ???????-??1
  • ????(Pattern Name)???????,??????????????????
  • ??(Synopsis)?????????????????????
  • ??(Description)???????????????????????????????
  • ????(Forces)????????????????,?????????????,?????
    ????????????

7
14-1-2 ???????-??2
  • ??(Implementation)????????????????
  • ??(Consequences)????????????????
  • ????(Related Patterns)??????????????,????????????
    ?????????

8
14-2 GRASP??
  • 14-2-1 ??????
  • 14-2-2 ?????
  • 14-2-3 ?????
  • 14-2-4 ??????
  • 14-2-5 ??????

9
14-2 GRASP??
  • GRASP?Craig Larman?????Applying UML and
    Patterns??????,Larman??GRASP????????????,?????????
    ?????,????????????????
  • GRASP??????,??????????????(Information
    Expert)????(Creator)????(Controller)?????(High
    Cohesion)?????(Low Couping)???

10
14-2-1 ??????-??
  • ??????(Information Expert Pattern)????????????????
    ???????,?????????????????????????????????
  • ???????????,???????????,????????

11
14-2-1 ??????-??(??)
  • ???????UML????????????????????,?????

12
14-2-1 ??????-??(????)
  • ??,???????????????????????????,??????????????????,
    ?????

??????? ??????? ????
?????? ?? ??
??????(????X??) ???? ????
?????? ?? ??
13
14-2-1 ??????-??(????????)
  • ?????????????,????????????,?????

14
14-2-2 ?????-??
  • ?????(Creator Pattern)????????????????,???A???????
    B????,??A????B????,?
  • ??A????B?
  • ??A??????B?
  • ??A?????????????B?

15
14-2-2 ?????-??(??)
  • ????????????,??????????????????????,?????

16
14-2-2 ?????-??(?????)
  • ??????????,???????????????????????????????,?????

17
14-2-3 ?????-??
  • ?????(Controller Pattern)?????????????(Non-UI
    Class)????????,?????Ivar Jacobson??????
  • ???????????????????????,???????????????,Larman????
    ?????????????????,????
  • ???????????????,??Facade????
  • ????????,???????????,?????????????????,?????????(U
    se Case Controller),??????????????????????????

18
14-2-3 ?????-??
  • ????????????????,??????????????????,????????,????
    ?

19
14-2-4 ??????-??
  • ?????????????,????????????,????,?????????,????????
    ????????
  • ??????(High Cohesion Pattern)????????,????????????
    ??(Key Abstraction),????,???????????????,?????????
    ??????,??????

20
14-2-4 ??????-??(?????)
  • ???????????????,?????

21
14-2-4 ??????-??(????)
  • ???????????????????,????????????????????,?????

22
14-2-5 ??????-??
  • ??????(Low Coupling Pattern)??????????????,???????
    ??????????
  • ??????????,???????????????,??????????????????,??,?
    ???????(Encapsulation)???????

23
14-2-5 ??????-??(?????)
  • ??????????,??????????,????????????????,?????????

24
14-2-5 ??????-??(?????)
  • ????????????????,????????????????,????????????????
    ??,?????????,??????????,?????????

25
14-3 Gang of Four????
  • 14-3-1 ???????
  • 14-3-2 ??????

26
14-3-1 ???????
  • ??????Christopher Alexander??????,???????????,???E
    rich Gamma?Richard Helm?Relph Johnson?John
    Vlissides(??Gang of Four)???????????Design
    PatternsElements of Reuseable Object-Oriented
    Software????
  • ????,??????????????,????????????????(Object-Orient
    ed Software Engineering)???????Gang of
    Four????23?????,??????
  • ????(Creational Patterns)
  • ????(Strutural Patterns)
  • ????(Behavioral Patterns)

27
14-3-2 ??????
  • ?????????????????????????????????,????????????????
    ??????,??????????????,????????????????????????????
  • ?????????????????
  • ?????????
  • ?????????

28
14-4 ??????
  • 14-4-1 Factory Method??
  • 14-4-2 Abstract Factory??
  • 14-4-3 Facade??
  • 14-4-4 State??
  • 14-4-5 Strategy??
  • 14-4-6 Flyweight??
  • 14-4-7 Singleton??

29
14-4-1 Factory Method??-??
  • Factory Method??????????,?????????????,???????????
    ??Factory Method??????????????,???????????????????
    ???,?????

30
14-4-1 Factory Method??-??
  • ????????????,???????????????????,?????

31
14-4-2 Abstract Factory??-??
  • Abstract Factory???????????,?????????????????????,
    ????????????,?????

32
14-4-2 Abstract Factory??-??
  • ?????????????????????????????,?????

33
14-4-3 Facade??-??
  • Facade??????????,???????????????????????,????????
    ???,Facade?????????????????????,??????,???????????
    ???????????

34
14-4-3 Facade??-??
35
14-4-4 State??-??
  • State??????????,???????????????????State??????????
    ?????,??????????????,?????

36
14-4-4 State??-??
  • ??????????????????????,??????????,????,?????,????
    ???,??????State??????????????,?????

37
14-4-5 Strategy??-??
  • Strategy??????????,???????????,?????????,?????????
    ?????????,Strategy???????????????State???????????
    ????,?????

38
14-4-5 Strategy??-??
  • ????????????????????????????,????????????,???????
    ??????????,?????????????????,??????Strategy???????
    ????,?????

39
14-4-6 Flyweight??-??
  • Flyweight?????????,????????????,??????????????,???
    ?????????,?????????????,Flyweight?????????????????
    ??,?????

40
14-4-6 Flyweight??-??
  • ?????????(Word)?????????????????????,????????????
    ?,??????????????????,Flyweight???????????????????
    ???(?Word???),????,???????????????,??????????????

41
14-4-7 Singleton??-??
  • Singleton?????????,??????????????,??????????????,?
    ????

42
14-4-7 Singleton??-??
  • Java????Singletion??????,????
  • public class Singleton
  • private static final Singleton INSTANCE new
    Singleton()
  • // Private???
  • private Singleton()
  • public static Singleton getInstance()
  • return INSTANCE

43
End
Write a Comment
User Comments (0)
About PowerShow.com