Presentation is loading. Please wait.

Presentation is loading. Please wait.

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.

Similar presentations


Presentation on theme: "SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand."— Presentation transcript:

1 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  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. 14.4

2 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed Design x Key:= secondary emphasis x = main emphasis ReviewFrameworksFramework UsagesFramework Development 2/24

3 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 Review FrameworksFramework UsagesFramework Development 3/24

4 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 Review Frameworks Framework UsagesFramework Development 4/24

5 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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) Review Frameworks Framework UsagesFramework Development 5/24

6 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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. Review Frameworks Framework UsagesFramework Development 6/24

7 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Why frameworks  Frameworks are the key to OO reuse  Frameworks reuse analysis and design, not just code.  Frameworks reuse overall architecture, not just components. Review Frameworks Framework UsagesFramework Development 7/24

8 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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. Review Frameworks Framework UsagesFramework Development 8/24

9 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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. Review Frameworks Framework UsagesFramework Development 9/24

10 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Domain classes Design classes Class Model vs. Architecture and Detailed Design Framework classes Detailed design Architecture Class Model for this application DP = design pattern Review Frameworks Framework UsagesFramework Development 10/24

11 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 ReviewFrameworks Framework Usages Framework Development 11/24

12 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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. ReviewFrameworks Framework Usages Framework Development 12/24

13 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 ReviewFrameworks Framework Usages Framework Development 13/24

14 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Framework development  Framework Design  Framework Implementation  Framework Testing  Documentation 14.4.4 Documentation Framework Design Framework Implementation Framework Testing Architectural Design ReviewFrameworksFramework Usages Framework Development 14/24

15 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 ReviewFrameworksFramework Usages Framework Development 15/24

16 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Seeking Generalization: Bottom-up 1. Start with classes in class model 2. Look for generalizations Procedure WinProblem Problem WinProcedure 14.4.4.1 ReviewFrameworksFramework Usages Framework Development 16/24

17 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 ReviewFrameworksFramework Usages Framework Development 17/24

18 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Seeking Generalization: Top-down 1. Start with libraries (e.g., MFC) 2. Look for opportunities to use ListIteratorList ScheduledEvents library ReviewFrameworksFramework Usages Framework Development 18/24

19 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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. ReviewFrameworksFramework Usages Framework Development 19/24

20 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 ReviewFrameworksFramework Usages Framework Development 20/24

21 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 ReviewFrameworksFramework Usages Framework Development 21/24

22 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Another strategy  Design framework - prototype several small applications  Build real application  Refactor and extend framework ReviewFrameworksFramework Usages Framework Development 22/24

23 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Summary of process  Start with examples of desired applications  Iteratively develop abstractions  Test by building applications ReviewFrameworksFramework Usages Framework Development 23/24

24 SWE 316: Software Design and Architecture – Dr. Khalid Aljasser 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 ReviewFrameworksFramework UsagesFramework Development 24/24


Download ppt "SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand."

Similar presentations


Ads by Google