140 likes | 263 Views
Design Patterns in Java. Kinematic Simulator. Kinematic Simulator. Hello, I’m Steve Here’s our project. Kinematic Simulator. Hello, I’m Helena Here’s our design. Instance Diagram. Class Diagram. Patterns Used: Model View Controller. SimulatorModel. SimulatorViewer. SimulatorController.
E N D
Design Patterns in Java Kinematic Simulator
Kinematic Simulator • Hello, I’m Steve • Here’s our project
Kinematic Simulator • Hello, I’m Helena • Here’s our design
Patterns Used:Model View Controller SimulatorModel SimulatorViewer SimulatorController
Patterns Used:Strategy SimulatorController (Context) PhysicsStrategy (Abstract Strategy) NewtonianPhysicsStrategy (Concrete Strategy)
Patterns Used:Observer observes ViewerListener SimulatorController SimulatorViewer
Patterns Used:Abstract Factory EntityFactory (Abstract Factory) Entity (Abstract Product) Ball Factory (Concrete Factory) Ball (Concrete Product)
Comparison of Old vs. New • Old: • Works • Everything has reference to everything else • Only simulates Balls • Few, big classes • Physics hard to find • AWT
Comparison of Old vs. New • New • Works • MVC cleans up data flow • Can add new Entities! I want to add squares. • Can add new Physics! • Can add new Views! • Great! • It don’t mean a thing if it ain’t got that Swing • Faster!
Questions? You can play at http://minutillo.com/steve/ks/ Thanks!