40 likes | 178 Views
Avoiding Powerpoint Karaoke Dr Stephen Marshall University Teaching Development Centre stephen.marshall@vuw.ac.nz. Design Examples. Object. Behaviour Each object has some behaviour that it supplies: A point in a graphics system: get coordinates, add to another point
E N D
Avoiding Powerpoint KaraokeDr Stephen MarshallUniversity Teaching Development Centrestephen.marshall@vuw.ac.nz Design Examples
Object • Behaviour • Each object has some behaviour that it supplies: • A point in a graphics system: get coordinates, add to another point • A bank account: withdraw, deposit, calculate interest, print statement • Every object can also be created and destroyed • What you get: • An obkects methods can access its private state • If you need to reprogram an object’s behaviour, you only need to reprogram that object, not the whole system (maybe…) • If other objects need to make use of a behaviour, they should use that object’s public interface • Identity • Each object can be distinguished from every other object: • Two bank accounts with the same name and balance are not the same account: • Withdrawals and deposits in one don’t affect the other • You can certainly have two accounts with teh same name • Different banks can have accounts with the same number
Problem A town needs public spaces. How big should they be? Context You are designing an Identifiable Neighbourhood Forces The square should be “full of life” People should enjoy just “hanging out” Solution Make squares no more than 15 or 20 metres across Known Uses Cuba Street Manners Mall Related Patterns Pedestrian Density Activity Pockets Positive Outdoor Space Building Fronts Stair Seats Something Roughly in the Middle Example: Small Public Squares
Issues in Composite • Explicit Parent references • Sharing components • Maximising the Component interface • Declaring the child management operations • Should Component implement a list of Components? • Child ordering • Caching to improve performance • Who should delete components? • What’s the best data structure for storing components?