210 likes | 214 Vues
Learn about the importance of software reuse, different types of reuse, pros and cons, introduction to frameworks, components of frameworks, types of frameworks, and an introduction to design patterns.
E N D
Ch 4:-Architecting & Designing Software Subtopics: Frameworks :Reusable systems Design Patterns
Frameworks: reusable systems What are re-use able systems? • Reuse: Reuse can be defined as adapting to an existing system. • It facilitates software development. • Frameworks are a software technology, that promotes reuse.
What is Software Reuse? • It is the process of implementing or updating software systems using existing software assets. • Software assets, include all software products, from requirements to specifications & designs. • Anything that is produced from a software development effort can be reused.
Why Reuse Software? • Reusable means developing software that is understandable & flexible enough to be used in a variety of systems. • It avoids redeveloping software. • Facilitates the increase of productivity, quality, and reliability, and the decrease of costs and implementation time.
Types Of Reuse Expertise Complete Applications Frameworks StandardDesigns Classes & Procedures
Pros & Cons of software reuse: PROS: CONS: • Efficiency • Standardization • Debugging • Profit earning • Mismatch: Design may not completely match your system. • Expense: Some components maybe too expensive for the project’s budget.
1. Frameworks: Introduction to frameworks Components of a framework Types of frameworks Object-Oriented frameworks Example
Introduction: • Framework: • Frameworks promote re-usability. • Provides common facilities which can be applied to various application programs. A framework is a reusable software that provides a generic solution to a generalized problem.
Principle behind a framework: “identify the common design elements & develop software that implements these design elements in a useful way.” • They are different from other subsystems, since they are intrinsically incomplete. • This means they comprise of classes & methods which are either undeveloped or missing.
Elements of a Framework • SLOTS: • Missing parts • Filled in by developer to suit the system. • Increases complexity. • HOOKS: • Similar to slots • Optional for the developer. • API: • Set of services provided by frameworks. • Consists of useful methods (functions).
Types of frameworks: HORI ZONTA L VERTICA L • Provides general application facilities to be used by large no. of applications. • It is a single API. • Larger no. of slots and hooks, since implementation is more general ¬ specific. • Produces complexity in the development process. • Provides general application facilities to be used by specific classes only. • Comprised of several horizontal frameworks. • Fewer slots &hooks since implementation is specific. • Allows easy development.
Services offered by the framework application application Horizontalframework Verticalframework slot hook slot hook Code to be provided to adapt the framework to the needs of the application Fig: Horizontal & Vertical Framework
Example: Library Management • Problem Definition: Design a framework , so that different libraries would be able to adapt to, meet their needs. List the kind of facilities you want to provide , if you were to design such a framework. In what way do libraries differ such that they would want to use a framework rather than a complete application.?
Solution: Common Factors Differentiating Factors • User interface for standard searches(browsing). • Basic classes for books, clients, &their common operations. • Methods that store the user info. Like address etc. .i.e. common data. • Kind of info kept about each member. • Rules of issuing book & fine schemes. • Specialized items that can be issued from the library. • Security mechanisms. • Integration of the system with other online libraries or books database.
Object-oriented frameworks: Developer Abstract Classes creates Method1(); Method2(); Concrete Class inheritance Subclass: Method1(); Method2(); Only SLOTS Actual methods
Patterns: • Patterns are recurring aspects of designs. • Used to create hierarchies of instances, i.e. General hierarchy. “ A pattern is the outline or a reusable solution to a general problem encountered in a particular context.”
Context References Problem A good Pattern Related Patterns Forces Anti patterns Solution
A good pattern should……. • Have a name. • Simple diagram, described in a narrative style. • The general situation. • Acknowledgements of contributors. • Recommended solution to the problem. • Issues to be considered while solving. • Main difficulty to be tackled.
TYPES Singleton Proxy Observer Facade Adapter
Thank you L.L.Britto,XIE,TE-I.T