Presentation is loading. Please wait.

Presentation is loading. Please wait.

Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.

Similar presentations


Presentation on theme: "Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks."— Presentation transcript:

1 Banaras Hindu University

2 A Course on Software Reuse by Design Patterns and Frameworks

3 by Dr. Manjari Gupta Department of Computer Science Banaras Hindu University

4 Lecture 9 Framework Documentation Using Hooks

5  higher development productivity,  shorter time-to market, and  higher quality,  these benefits are  only gained over time and  require up-front investments. frameworks promises

6  users usually need to spend a lot of effort on understanding its  underlying architecture  design principles  on learning how to customize it  significantly reduced with good documentation and training material steep learning curve

7  quickly understanding and applying a framework  at least four different categories of frameworks concerning persons  Frameworks developers  Frameworks selectors  Frameworks users (Application developers)  Frameworks maintainers and developers of other frameworks steep learning curve Cont…

8  framework documents focus on  What the framework does  How to use it  Design of the framework  approaches proposed to document a framework  providing multiple views of the design,  using exemplars,  using design patterns,  using metapatterns,  using cookbooks,  using hooks and so on. Framework Documentation

9  Six view approach  Documenting classes  Documenting relationships Campbell and Islam’s approach

10  Concrete implementation for all  Abstract classes  Interaction Exemplars [Gangopadhyay95]

11  Very much popular  Using patterns Pattern Language

12  Froehlich developed the notion of hooks  Specify how to reuse a framework  Specify how the framework is intended to be used.  Each hotspot tends to have several hooks within it.  A hook is  inheriting from an existing class in the framework,  adapting the interaction of a large number of classes within the framework. Hooks

13  The framework builder defines the hooks  help to ensure that changes or extensions integrate smoothly into the design and implementation  provide an alternative and supplementary view to design documentation  show how and where a design can be changed.  is a point in the framework that is meant to be adapted in some way by  selecting options,  filling in parameters or  creating subclasses. HooksCont…

14  documents a problem or requirement  provides guidance about how to use the hook and fulfill the requirement.  details the changes to the design that are required,  specify the constraints that must be adhered to and  specify any effects upon the framework that the hook will impose.  Application developer uses the hook to adapt the framework simply by performing all of the changes within the changes section of the hook in the order given. HooksCont…

15  specific format made up of several sections  sections detail different aspects of the hook  sections serve as a guide to the people writing the hooks  The format in which hooks are described helps to  organize the information and  make the description more precise and less ambiguous than pure English narrative. Hook Description

16  Name  Requirement  Type  Area  Uses  Participants  Changes  Constraints  Comments Hook DescriptionCont…

17  two characterization types  the method of adaption  indicates the type of change that the hook uses  Gives an idea of what the hook does  support type  indicates how difficult it may be to use.  can also serve as a basis for locating a desired hook.  the level of support  indicates how much support the hook provides for the adaption  support type indicates how difficult the hook may be to use. Characterizing hooks

18  Enabling a feature  Disabling a feature  Replacing a feature  Augmenting a feature  Adding a feature Method of Adaption

19  Option  Supported Pattern  Open-ended Level of Support

20  provides the most support  A number of pre-built components are provided and the developer simply chooses one or more without requiring extensive knowledge about the framework.  components are chosen to  enable features within the framework or  to replace default components.  describes the options and how the chosen option(s) can be inserted into the framework  black-box approach Option Hook

21  single option hook  multi-option  describe the options and how the chosen option(s) can be inserted into the framework.  If none of the choices are suitable  another hook of a different support type may be provided to allow the developer to produce his/her own solution. Option HookCont…

22  are selection oriented.  The changes section outlines  how to choose the components  how to incorporate the chosen components into the application.  The constraints section details  how the selected components affect the rest of the framework. Option HookCont…

23  predefined method of fulfilling a requirement  but the details of the method are application dependent  filled-in by the application developer  no complete pre-defined components to choose from, but support is provided for the feature through parameters to components.  often enable, augment, remove or replace features. Supported Pattern Hooks

24  needs to supply values or parameters to a single class  The parameters themselves may be  base variables, or  methods or  component classes.  Some common tasks may require the collaboration of multiple classes, and may also have application specific details.  The flow of control is already defined within the hook Supported Pattern HooksCont…

25  Changes section can include  new subclasses, or  methods to be overridden or specialized, or  parameters to be filled in  the creation of entirely new classes or new operations is generally not allowed.  some behavior of methods may also be included.  The constraints section will give details on  special conditions placed on the parameters or methods  the effects that using the pattern has on the rest of the framework. Supported Pattern HooksCont…

26  requires more knowledge about the framework than does using an option hook  developer does not usually  need to worry about unwanted interactions, or  require a deep understanding of the design of the framework. Supported Pattern HooksCont…

27  components or parameters for every possible use cannot be provided.  the framework does not provide direct support for the required change, although it may not hinder it either.  used to point to places in the framework that can be changed by a developer to fulfill certain requirements  These changes will be for  adding, replacing, removing or augmenting features within the framework. Open-ended Hooks

28  If the requirement fulfilled by the changes may be applicable to more than one application and no hook exists for it  a new open-ended hook can be defined for the framework.  The changes section will often include  the introduction of new classes which are not subclasses,  the introduction of new operations to classes, and  sometimes the removal or replacement of code in addition to what is done in pattern hooks.  includes explicit control flow information to show the new paths of control that the hook introduces. Open-ended HooksCont…

29  The constraints section  indicate the effects that using the hook has on the rest of the framework.  The knowledge about the framework required to use open-ended hooks is generally greater than with the other two support types.  the developer has to be more careful about the effects changes will have on the framework. Open-ended HooksCont…

30  ways in which the correct hook could be found  the area and type characterization for a hook  requirements section for a specific requirement  each part of the design can be connected to the hooks that extend or modify it  A browser which provides hooks as an alternative view to the design is needed.  The presence of hooks does not preclude the need for other types of documentation.  hooks will never be able to describe all changes that might be made to a framework.  design of the framework would be needed to obtain more information. Finding the correct hook

31  Tool support for the use of individual hooks,  Tool support in the area of evolution of frameworks  A browser for finding the most appropriate hook is needed.  It would also be desirable to connect hooks to the design of the framework  The use of individual hooks may be partially automated.  select a hook  the system guide them through the use of it. Future work

32  If the hooks provided for the framework are not useful to developers  the framework may not be meeting its intended purpose and needs to be modified or evolved.  A framework might also evolve to incorporate more support for commonly used hooks.  An open-ended hook may evolve into a pattern hook  A pattern hook may evolve into an option hook  In particular, if a number of open-ended hooks are commonly used, then the framework might evolve to incorporate the new features the open-ended hooks provide.

33


Download ppt "Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks."

Similar presentations


Ads by Google