1 / 16

SWC – Introduction to Software Architecture

SWC – Introduction to Software Architecture. What is SW Architecture?. A large topic! We will only – for now – consider the most basic concepts in SW architecture Purpose mainly to have a (small) vocabulary, for discussing organisation of classes

holly-duffy
Download Presentation

SWC – Introduction to Software Architecture

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. SWC – Introduction to Software Architecture

  2. What is SW Architecture? • A large topic! • We will only – for now – consider the most basic concepts in SW architecture • Purpose mainly to have a (small) vocabulary, for discussing organisation of classes • Think of SW architecture as a tool or guideline for class organisation SWC

  3. Architecture is Structure • We know that ”classes should have as few responsibilities” as possible • Should classes then only have one method!? • What types of ”responsibilities” are we talking about…? SWC

  4. Architecture is Structure • A typical (large) program involves • User interaction (GUI) • Business logic and control (rules, Use Cases,…) • Data storage (both in memory and persistent) • A class should usually not have responsibilities within more than one of the above categories SWC

  5. Architecture is Structure Application GUI Control (Logic) Model (Data) SWC

  6. Architecture is Structure • Why only responsibilities within one category? • Usually, we aim for flexibility • Examples: • Being able to replace the GUI, without changing the remaining classes • Being able to replace the storage strategy, without changing the remaining classes • … SWC

  7. Architecture is Structure • We often refer to the elements in a SW architecture in terms of layers • The top-level architecture typically contains: • A GUI layer • A Control layer • A Model layer • Inside a layer, we can define packages of classes SWC

  8. Layers • What goes into the GUI layer…? • All classes that are related to implementing the GUI in itself (frames, panes, controls, event handlers, etc.) • Could also contain utility classes related to GUI, GUI base classes, etc. SWC

  9. Layers GUI Layer RegisterItemGUI Register CustomerGUI …GUI GUIUtility SWC

  10. Layers • What goes into the Control layer…? • Classes that control the ”flow” of a Use Case, i.e. handler-type classes • Classes that contain logic (rules, procedures, etc.) for the business domain SWC

  11. Layers Control Layer Handler Package Business Logic Package Register Item Handler Shipping Cost Calculator SWC

  12. Layers • What goes into the Model layer…? • Classes that model domain objects, like Car, Item, Boat, Order, Contract, etc. • Classes that manages collections of data, i.e. catalog-type classes • Classes that manage persistent data storage, like database-oriented classes SWC

  13. Layers Model Layer Domain Model Package Data Collection Package Persistence Package Item Item Catalog DB Item Catalog SWC

  14. 1.Semester view • We look at architecture in a slightly simplified way during 1.semester • We only think in terms of layers and classes • There are no classes for persistent data storage involved, only domain and catalog classes • We rarely have any dedicated classes for business logic and rules (logic is in handler classes) SWC

  15. 1.Semester view Application GUI Layer Control Layer Model Layer RegisterItemGUI ItemCatalog RegisterItem Handler Item RegisterBorrowerGUI BorrowerCatalog RegisterBorrowerHandler Borrower SWC

  16. Architecture is Structure • Think of a SW architecture as a tool for obtaining structure on the set of classes in your application • Classes should fit naturally into your architec-ture; if not, you may need to redesign, break a class into smaller classes, etc. • If you do proper design work, your classes will fit the architecture almost ”for free” SWC

More Related