Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

Pattern: Instantiating a Framework

You have been given, or previously selected, a framework to use as a solution for a specific problem. You are now about to instantiate the framework in order to implement the intended functionalities and build your application.

Problem

Framework instantiation usually consists on deducing, designing and implementing application-specific extensions to the framework. Despite knowing which extensions the framework requires, it is hard to understand where to “plug” those extensions in the framework.

What do you need to learn about a framework in order to instantiate it quickly?

Forces

Documentation. Tutorial documentation can help you to walkthrough the initial contact with the framework and to acquire knowledge about the framework’s entry points.

Effort. You don’t want to spend too much time learning what you need to know to instantiate the framework.

Learner’s experience. If you are already familiarized with the framework, you try to find similar areas of flexibility. A novice learner will look for demonstrating examples that might give her a hint of where to start poking the code for hot-spots.

Complexity. Complexity may not mean “difficult to use”, but surely means “difficult to learn”. Issues like indirection, abstraction and obscurity give the framework its power but also hinder its ability to be learnt and understood.

Solution

Find the areas of customization of the framework by looking at the existing documentation and resort to instantiation examples to clarify on how to use those areas.

Look at the documentation to find the CUSTOMIZATION POINTS of predefined refinement where framework instantiation is supported. In addition, look also into some GRADED EXAMPLES that explain how to use the framework to implement more common functionalities. The customization of a framework is usually possible through sub-classing of framework abstract classes and/or composition of concrete classes. Understanding how these classes relate and interoperate is crucial to be able to use them properly.

If you’re dealing with a white-box framework, it is important to further UNDERSTAND THE ARCHITECTURE and to UNDERSTAND THE DESIGN INTERNALS . Only then you can start to UNDERSTAND THE SOURCE CODE and effectively start reusing the framework.

To be more effective, you may consider to DRIVE YOUR LEARNING according to your experience and specific requirements.

Consequences

Framework know-how. You gain knowledge on how to instantiate the framework, progressively increasing your expertise and being able to incrementally build your application.

Blind trust. Using a framework means trusting in code you have never seen. So if the framework is poorly built or has features that it publicizes but are not implemented or don’t work well, your solution may suffer with it. It’s not rare to see frameworks whose internal code is not available for debugging or modification.

Rationale

Framework instantiation into domain-specific application takes place at points of predefined refinement called hot-spots [Pre95]. Thus knowing where and how to use these points leads to an effective framework instantiation. Moreover, [FS97b] the best way to start learning a framework is by example [FSJ99a]. Most frameworks come with a set of examples that you can study, and those that don’t are nearly impossible to learn. Examples are concrete, thus easier to understand than the framework as a whole. Frameworks are easier to learn if they have good documentation.

See also

In [FHL97], Froelich et al. resort to a Hooks-model to describe the framework customization points and use it to instantiate the SEAF (Size Engineering Application Framework). Their approach is similar to this as is relies on documentation describing the customization points (hooks) and uses it to know where to instantiate the framework.

fudocs/instantiatingaframework.txt · Last modified: 2015/07/22 20:35 (external edit)
Trace: instantiatingaframework
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0