180 likes | 321 Views
Architectural Styles. SAIP 5. Styles are Patterns. Bigger than design patterns More abstract than reference models domain independent not a particular design rules for design. Styles are Patterns. Similar need examples to understand must use before you understand fully
E N D
Architectural Styles SAIP 5
Styles are Patterns • Bigger than design patterns • More abstract than reference models • domain independent • not a particular design • rules for design
Styles are Patterns • Similar • need examples to understand • must use before you understand fully • advantages and disadvantages • every use is different • many variations
Styles are patterns • Different • so big, and with so many variations, that it is better to think of them as a set of patterns Pattern Oriented Software Architecture • so big that you could write a book on each one • so big that people tend to know just a few
Three Styles in One System • Layers • Dataflow (Pipes and Filters) • Object-Oriented
The System • Framework for music improvisation • Bill Walker • Two applications • Jazz piano duets • Extreme modern electronic improvisation http://datura.cerl.uiuc.edu/BillWalker/ dissertation/Dissertation.html
The Layers Control Music transformation Music Representation Hardware
Dataflow architectural style • Components are filters • Filters transform input to output • Filters don’t • share state • know identity of input or output • Example: Streams
Advantages of dataflow • Easy to understand • Easy to change • Easty to maintain • Components are reusable • Handle parallelism well
Disadvantages of dataflow • Not good for interactive processing • Doesn’t handle separate but related streams very well. • Doesn’t model state very well.
Music Improvisor MIDI Chord Finder chords Sequence Finder Keyboard sequences Transformer chords Chord Builder MIDI out sequences
Dataflow • Pull • getNext() • multiple inputs easy, multiple outputs hard • Push • putNext(data) • multiple outputs easy, multiple inputs hard • Pipes and filters • filter is a process • less efficient
Data Representation MusicalObject * * * Midi Event Note Chord Sequence
Dataflow Stream Chord Builder Retrograde Keyboard Chord Finder Sequence Finder
Use of OO Techniques • Polymorphism makes it easy to make new combination of components • At runtime! • Inheritance makes it easier to make new component
Summary: 3 styles • Layers divides system into three parts • Dataflow organizes one layer • OOP is used to describe data (bottom layer), provide reusable components for dataflow system (middle layer) and to implement the control system (top layer).
Criticism • SAIP claims that you decide the qualities that you want and then pick a style • but many styles for each quality • but many other considerations in picking style • which ones you know • compatibility with other architectural choices • styles are more complicated than they indicate
Summary • Architectural styles are very important • More complex than indicated by book • It takes a long time to learn a new style, but it is worth it • We need better descriptions of the styles!