Transcript slides14

CPS 108

Object oriented design and programming of medium-sized
projects in groups using modern tools and practices in
meaningful ways

High level OO concepts
 XP: Extreme Programming: simplicity, refactor, grow code
 Tell, don't ask: designing classes
 Open/Closed: open to extension, closed to modification

Learn to manage time, improve coding methods, e.g., can you
really code effectively at 3:00 am?
Software Design
14.1
Essential Design Patterns (by name)






MVC, aka Observer/Observable
 Separate concerns, especially important for GUIs
Composite
 Container is/contains JComponent: File/Directory
Factory
 Separate creation from class, install new creators
Proxy/Adapter
 Stand-in with same interface, adapt interface as needed
Decorator
 Is-a and Has-a, e.g., Filters and java I/O
Command
 Function/request object, undoable action
Software Design
14.2
Patterns continued





Singleton
 Enforce single point of creation, conserve resources
Template method
 Hooks filled in by sublcasses
Iterator
 Common from previous courses, essential in Java
Strategy
 Human player, AI, change algorithm
Forces in a problem lead to solution via appropriate pattern
 Should know what GOF is: gang of four
Software Design
14.3
Something old, something new

CPS 108 has used Java since 1996 always with C++
 Before ’96 used Tcl/Tk or Python
 Starting with Java is problematic, what to read?
 What if 6/100 move to Java?

Is Unix an issue? More time with Windows programming
environments? Linux or Mac?
 Eclipse as cross-platform environment

What about groups?
 110 model, keep same group always
 108 model, chaotic? Re-randomize? Always choice?
Software Design
14.4
OOGA

Architectural issues important, leverage a good system-level
architecture into easier-to-develop games/programs
 Ambitious groups can get away without an architecture,
but a good architecture really helped ease development
 MVC really worked, better than in the past?

Networking comes too late? Not next time?
Should require an AI for some games, talk about this or
provide code?
Card games would also be architecturally interesting
 Solitaire? Other games? Build on freecell?


Software Design
14.5
Post-mortem evaluation





Need smaller programs ?
Mastery projects?
 C++ inheritance, templates,
low-level C, sockets
 Java GUI, threads, web,
network
Success: OOGA, Freecell (kind
of)
Failure: Hyperwag
Success: Set your own
standards, don’t meet my
requirements
Failure: Reading about
software, aesthetics, ethics, …
Software Design










Failure: feedback
Success: coding examples,
MVC
Failure: feedback
Success/Failure: understanding
group dynamics
Failure: coding standards
Failure: using books
Success: pattern examples
Failure: pattern re-use
Success: tell don't ask
Overall grade: _______
14.6
Why is programming fun?
What delights may its practitioner expect as a reward?
First is the sheer joy of making things
Second is the pleasure of making things that are useful
Third is the fascination of fashioning complex puzzle-like objects of
interlocking moving parts
Fourth is the joy of always learning
Finally, there is the delight of working in such a tractable medium. The
programmer, like the poet, works only slightly removed from pure
thought-stuff.
Software Design
Fred Brooks
14.7
Fred Brooks




… on computing pioneer Howard
Aiken "the problem was not to keep
people from stealing your ideas, but
to make them steal them."
Duke valedictorian 1953, started
UNC Computer Science Dept in
1964, won Turing Award in 1999
Mythical-Man Month, "Adding
man-power to a late project makes it
later", … "There is no silver-bullet
for Software Engineering… [because
of essential complexity]"
Chaired Executive Committee of the
Central-Carolina Billy Graham
Crusade in 1973
Software Design
14.8