Design Patterns Final

Card Set Information

Design Patterns Final
2014-04-20 14:00:39
final exam

final exam c++
Show Answers:

  1. Bridge intent
    decouple an abstraction from its implementation so that the two can vary independently
  2. bridge motivation
    separate platform implementation hierarchy from the abstraction heirarchy
  3. bridge applicability
    • avoid a permanent binding between an abstraction and its implementation
    • both the abstraction and implementation should be extensible by subclassing
  4. bridge - changes in the implementation of an abstraction
    • should have no impact on clients
    • hide the implementation of an abstraction completely from clients
  5. why a bridge?
    eliminate the complexity and error associated with "nested generalizations" (multiple inheritance)
  6. bridge - pro
    share an implementation amount multiple objects but hide this fact from the client
  7. lexical_cast<>
    type-safe ways of casting from one type to another
  8. asio
    asynchronous input/output. great for working with sockets Ipv4/Ipv6
  9. share_ptr
    • reference-counted smart pointer
    • avoids memory leaks
  10. TCP
    • Transmission control protocol
    • connection oriented
    • data can be sent bidirectional
  11. UDP
    • User Datagram Protocol
    • connectionless
    • multiple messages are sent as packets in chunks
  12. TCP vs. UDP usage
    • tcp - high reliability with time less critical
    • udp - fast - useful for servers that answer small messages from a lot of clients
  13. tcp vs. udp examples
    • tcp - http
    • udp - dns
  14. CRTP
    • curiously recurring template pattern
    • a class T, inherits from a template that specializes on T.
  15. Mixin
    • a class that is intended to be reused through direct insertion in another piece of code. 
    • counting example - one count for everything
  16. derived
    any class that inherits from any other derived class