1 / 24

Lecture 11 : Frameworks

SWE 316: Software Design and Architecture. Lecture 11 : Frameworks. 14.4. To understand … the meaning of “frameworks” To be able to … build frameworks … complete a detailed design .

kylee
Download Presentation

Lecture 11 : Frameworks

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. SWE 316: Software Design and Architecture Lecture 11 : Frameworks 14.4 • To understand • … the meaning of “frameworks” • To be able to • … build frameworks • … complete a detailed design Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

  2. 2/24 Review Frameworks Framework Usages Framework Development Process Phases Discussed in This Chapter Requirements Analysis Design Framework Architecture Detailed Design Implementation Key: = main emphasis = secondary emphasis x x

  3. 3/24 Review Frameworks Framework Usages Framework Development What is a software architecture? • An architecture for a software application is its high level design, enabling software engineers to gain understanding • An early stage of the system design process • It involves identifying major system components and their communications • Represents the link between specification and design processes

  4. 4/24 Review Frameworks Framework Usages Framework Development Framework • Framework --- a collection of classes applicable to multiple applications • Business logic: the parts that are particular to an application and are often not reused. • Reusability can be at the architecture level, design level, and code level • Try to answer the following questions: • Where do we keep classes slated for reuse? • How do we organize them? • Should we build in relationships among these classes. 14.4

  5. 5/24 Review Frameworks Framework Usages Framework Development The meaning and usage of frameworks • A framework is a collection of software artifacts that is usable by several different applications • Classes within a framework may be related and applications may use them by means of inheritance, aggregation or dependency. • E.g. • Java API’s (3D, 2D, Swing) • The Enterprise Java Bean (EJB)

  6. 6/24 Review Frameworks Framework Usages Framework Development Framework definitions • A framework is a set of cooperating classes that comprise a reusable backbone for a specific application domain. • A framework provides an integrated set of domain- specific functionality • A framework is a semi-complete application • A framework is customized to a particular application by deriving application specific classes from abstract classes defined by the framework.

  7. 7/24 Review Frameworks Framework Usages Framework Development Why frameworks • Frameworks are the key to OO reuse • Frameworks reuse analysis and design, not just code. • Frameworks reuse overall architecture, not just components.

  8. 8/24 Review Frameworks Framework Usages Framework Development Framework challenges • Developing high quality reusable extensible frameworks for application domains involves complicated tasks. • It takes a substantial amount of time and effort to learn how to utilize OO application frameworks. • Requirements of frameworks often change with changing application requirements. • Frameworks need maintenance including both adaptation and modification. • No current common standards exist for the design, implementation, documentation, and adaptation of frameworks.

  9. 9/24 Review Frameworks Framework Usages Framework Development Frameworks vs. components • Frameworks have lots of room for customization and they have interfaces that are more complex than those of many other components. • Frameworks and other software components are different but cooperating technologies. • Frameworks are built from building blocks, which are their component classes. • At the same time, frameworks themselves are application building blocks and are used to build larger systems.

  10. 10/24 Review Frameworks Framework Usages Framework Development Class Model vs. Architecture and Detailed Design Frameworkclasses DP Architecture DP Design classes DP Detailed design DP DP DP Domain classes Class Model for this application DP = design pattern

  11. 11/24 Review Frameworks Framework Usages Framework Development Framework Usages 1- Toolkit • “Bag of tools” with no architectural assumption, e.g. java.math • A collection of useful classes • Each usable in isolation • (Sometime not called a framework) 2- Abstract architecture • Common denominator of architecture, with architectural assumption, e.g. java.awt and container class • An architecture in the abstract 3- Control • A system containing control, e.g. java.applet • Follow the protocols to obtain your application 14.4.2

  12. 12/24 Review Frameworks Framework Usages Framework Development Selected Framework Goals • Persistence Service • Store instances between executions • Identity Service • Identify objects sufficiently to retrieve them across executions • Pooling • - of objects: Reusing objects at runtime to save time and space • - of threads • - of database connections • Security 14.4.3 Goal : Reuse We Use Frameworks …to reuse classes, relationships among classes, or pre-programmed control.

  13. 13/24 Review Frameworks Framework Usages Framework Development Framework design Issues • Keep it simple • Be consistent • Don’t make things almost the same • Design to prevent user errors (i.e. naming conventions) • Have default behavior • Have documentation especially for interactions

  14. 14/24 Review Frameworks Framework Usages Framework Development Framework development Framework Testing • Framework Design • Framework Implementation • Framework Testing • Documentation Framework Implementation 14.4.4 Documentation Framework Design Architectural Design

  15. 15/24 Review Frameworks Framework Usages Framework Development Principles of framework design • First rule: • Don't design, buy one, instead. • Designing reusable code requires iteration • Reusable code requires many iterations. • Basic law of software engineering: “if it hasn't been tested, it doesn't work”, thus software that hasn't been reused is not reusable. • Frameworks encode domain knowledge • Frameworks solve a particular set of problems. • Not always application-domain specific • Customer of framework is application programmer • Frameworks are abstractions: people generalize from concrete examples

  16. 16/24 Review Frameworks Framework Usages Framework Development Seeking Generalization: Bottom-up 14.4.4.1 Problem Procedure WinProblem WinProcedure 1. Start with classes in class model 2. Look for generalizations

  17. 17/24 Review Frameworks Framework Usages Framework Development Ideal way to develop framework • Analyze problem domain • Learn well-known abstractions. • Collect examples of programs to be built from framework. (Minimum of 4 or 5). • Design abstraction that covers examples. • look for commonalities, represent each idea once. • Test framework by using it to solve the examples. • Each example is a separate application. • Performing a test means writing software. Analysis Design Test

  18. 18/24 Review Frameworks Framework Usages Framework Development Seeking Generalization: Top-down library List ListIterator ScheduledEvents 1. Start with libraries (e.g., MFC) 2. Look for opportunities to use

  19. 19/24 Review Frameworks Framework Usages Framework Development Why ideal is never followed • Analyzing domain requires analyzing individual examples, which is very hard. • Only practical if examples have already been analyzed. • Analyzing and implementing examples is large fraction of the cost of the project. • Old applications work, so there is no incentive to convert them to use framework.

  20. 20/24 Review Frameworks Framework Usages Framework Development Good way to develop framework • Pick two similar applications. • Include developers experienced in the same domain. • One framework group • Consider other applications • Explain and teach framework • Two application groups • Try to reuse as much software as possible • Complain about how hard software is to use

  21. 21/24 Review Frameworks Framework Usages Framework Development Typical way to develop framework • Notice that many applications are similar. • Develop next application in that domain in an OO language. • Divide software into reusable and non-reusable parts. • Develop next application reusing as much software as possible. Framework is not very reusable Fix it Develop next application reusing as much software as possible

  22. 22/24 Review Frameworks Framework Usages Framework Development Another strategy • Design framework - prototype several small applications • Build real application • Refactor and extend framework

  23. 23/24 Review Frameworks Framework Usages Framework Development Summary of process • Start with examples of desired applications • Iteratively develop abstractions • Test by building applications

  24. 24/24 Review Frameworks Framework Usages Framework Development Summary • A framework is a collection of software artifacts that is usable by several different applications • Frameworks reuse overall architecture, not just components. • Framework development • Several strategies e.g., Top-Down, Bottom-Up

More Related