60 likes | 202 Views
CSC 480 – Software Engineering. Workshops 5 & 6 Design Patterns. Make Parts (components ) into a Unit ( composite). Client. Composite pattern. Hide Parts Using a Façade ( MyGameTank ). Client. Façade pattern. Decouple Client w/ Concrete Tank. Abs. Factory pattern.
E N D
CSC 480 – Software Engineering Workshops 5 & 6 Design Patterns
Make Parts(components) into a Unit (composite) Client Composite pattern
Hide Parts Using a Façade(MyGameTank) Client Façade pattern
Decouple Client w/ Concrete Tank Abs. Factory pattern
Adding a New Tank Type w/ Ease E1T1TankFactory +createTank():E1T1Tank +createShell():E1T1TankShell E1T1Tank E1T1TankShell
Handling User Input w/ KeyListener Command pattern A hook method in the Java AWT API <<interface>> KeyListener +keyPressed(e:KeyEvent) +keyReleased(e:KeyEvent) +keyTyped(e:KeyEvent) MyGameFrame KeyHandler AbstractTank MyGamePanel +keyPressed(e:KeyEvent) +keyReleased(e:KeyEvent) +keyTyped(e:KeyEvent)