1 / 7

Structural Patterns

Structural Patterns. Class patterns – inheritance Object patterns – composition - you can change the composed class at run-time. class UsefulClass useful_operation() Class NicksClass UsefulClass myUsefulClass; nicks_operation() { myUsefulClass.useful_operation() }.

sanura
Download Presentation

Structural Patterns

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Structural Patterns Class patterns – inheritance Object patterns – composition - you can change the composed class at run-time

  2. class UsefulClass useful_operation() Class NicksClass UsefulClass myUsefulClass; nicks_operation() { myUsefulClass.useful_operation() }

  3. OtherClass Request()

  4. Bridge Abstraction – the set of operations a class or class hierarchy must support Implementation – Different ways of performing those operations

  5. DataImp UpdateData changeGrade(name…) changeGrade(name…) SQLupdate PickleUpdate changeGrade(name…) { Send SQL update cmn To database changeGrade(name…) { Read in data, change it, Write to file

  6. DataImp UpdateData changeGrade(name…) changeGrade(name…) ? ? SQLupdate PickleUpdate changeGrade(name…) { Send SQL update cmn To database changeGrade(name…) { Read in data, change it, Write to file

More Related