180 likes | 226 Views
Frameworks and Hooks. by Garry Froehlich Paul Sorenson SERL (Software Engineering Research Lab). Software Reuse. Software reuse is the process of creating software systems from existing software systems. (Krueger, 1992) High level languages Code scavenging Code components
E N D
Frameworks and Hooks by Garry Froehlich Paul Sorenson SERL (Software Engineering Research Lab) SERL - Software Engineering Research Lab
Software Reuse Software reuse is the process of creating software systems from existing software systems. (Krueger, 1992) • High level languages • Code scavenging • Code components • Design patterns • Object-oriented frameworks • Application generators SERL - Software Engineering Research Lab
Object-Oriented Frameworks • The reusable design of a system or subsystem implemented through a set of classes and their collaborations. • Users complete or extend the framework by adding or customizing application specific components to produce an application. Framework Application Components SERL - Software Engineering Research Lab
Users and Developers of Frameworks • There are three main roles associated with frameworks: • Framework designers, also called framework developers or framework builders, develop the original framework • Framework users, also called framework clients or application developers, use the framework to develop applications. • Framework maintainers refine and redevelop the framework to fit new requirements. SERL - Software Engineering Research Lab
Framework Design • Frameworks differ from applications • the level of abstraction is different as frameworks provide a solution for a family of related problems, rather than a single one. • to accommodate the family of problems, the framework is incomplete, incorporating hot spots and hooks to allow customization • Frameworks must be designed for flexibility, extensibility, completeness and ease of use. SERL - Software Engineering Research Lab
HotDraw Overview • A framework for developing structured graphical editors. • Smalltalk version maintained by Ralf Johnson’s group at the University of Illinois. SERL - Software Engineering Research Lab
HotDraw Framework Tool Drawing Controller Figure Drawing View Handle Composite Figure Rectangle Figure Arrow Figure Drawing SERL - Software Engineering Research Lab
Hot Spots and Hooks • Frozen Spots: capture the commonalties across applications. • Hot Spots: general areas of variability within a framework. • Hooks: specific ways in which a framework can be customized. Drawing Controller Tool Select Tool New Tool New Tool Type SERL - Software Engineering Research Lab
RCIM Graphical Display Figure Handle Composite Figure Rectangle Figure Text Figure RCIM Figure Drawing Layout Manager RCIM Drawing SERL - Software Engineering Research Lab
Framework Use • A framework is chosen to match the application requirements. • Framework users must learn the framework before they can develop an application from it. • The application design has to conform to the concepts provided by the framework. Users build extensions to the framework. • Multiple frameworks can be used in a single application, but there may be gaps or overlap in the functionality they provide. SERL - Software Engineering Research Lab
Learning to Use the Framework • Frameworks can be difficult to learn so a means of lowering the learning curve is needed. • Tutorial sessions can be held to allow the framework builders to show users what can be done with the framework. • Tools can be used to investigate the operation of the framework and to allow the use of the hooks without learning the whole framework. • Documentation can describe the design and intended use of the framework, and provide examples of use. SERL - Software Engineering Research Lab
Framework Experience Framework developments we have been involved in: • EAF (Engineering Application Framework)and Prothos (e-commerce framework)- see www.avrasoft.com • CSF - Client Server Framework - see www.cs.ualberta.ca/~garry/framework/ • Sandwich - Personal Proxy Assistant Framework SERL - Software Engineering Research Lab
Framework Evolution • Framework evolution might be categorized as anything beyond use as-is and completion. • Refactorings can be used to restructure the framework while preserving its behavior. • Design patterns can be applied to make the framework more flexible. • What happens to applications when frameworks evolve? SERL - Software Engineering Research Lab
Framework Benefits • Reusable implementation and design that captures the expertise of developers within a domain. • The framework should have a quality design which will be ‘inherited’ by applications. • Decreased development time. • Reduced maintenance costs from maintaining a common code base. SERL - Software Engineering Research Lab
Framework Concerns • Building a framework requires more resources than building a single application. • When a framework evolves, all applications built from the framework are affected. • A complex framework can take a significant amount of time to learn before it can be used effectively. • It isn’t always easy to determine if the framework is compatible with the desired application. SERL - Software Engineering Research Lab
Research Issues • What constitutes framework breakage and what are the issues related to evolvability? (Role of design patterns) • How are frameworks most effectively learned? • Creating of tools in support of framework use - in particular HookMaster. • Exploring the use of experience bases in conjunction with framework development, use and evolution. (FrameScan study) • Continuing to build new frameworks to understand the issues better. SERL - Software Engineering Research Lab
Conclusion • An object-oriented framework is the reusable design and implementation of a system or subsystem. • Frameworks are meant to help solve a set of related problems through design reuse. • Design patterns are proven solutions to common design problems and can be used to build frameworks. SERL - Software Engineering Research Lab
Potential Collaborative Work • “Integration” framework. • Identifying “hotspots” in current customizations => use cases for framework development and evolution • Use of reengineering tools to assist in better understanding of the existing code base. • Process and quality issues?? SERL - Software Engineering Research Lab