In JUnit Recipes, JB Rainsberger points out this idiom: static final Set s = new HashSet() {{ add(“this”); add(“that”); add(“another”); }}; (JB points to an article by Paul Holser, which cites Dave Astels’ Test-Driven Development as the source.) What’s it do? The new HashSet(){}; part creates an anonymous subclass (a new type of HashSet without […]
By B. Douglas Wake and William C. Wake Summary: Sometimes we have information that is potentially useful or important, but is not normally of interest. This pattern discusses when and how to hide this information in plain sight. Context Information is designed using a high format and a powerful (often new) tool. Information is viewed […]
Pattern Patter: Renderer
Summary: Use renderers to show sub-views. Context You’ve separated the model of a complex object from its view (as in Observer or Model-View-Controller). The bulk of the view doesn’t change much. Variable items (“cells”) in the model may require a specialized sub-view. Solution Divide the view into two parts. Let the main view display the […]
Not all frameworks are alike. One way to distinguish between them is the notion of white box vs. black box. A white-box framework requires the framework user to understand the internals of the framework to use it effectively. In a white box framework, you usually extend behavior by creating subclasses, taking advantage of inheritance. A […]
Growing Frameworks: Miscellany
Philosophy Interfaces Generic Hotspots Graph Workflow Reporting Drawing Graph G = <N,E> N & E = 0 E = <N,N> Graph – Node – Edge ================================ Graph 1. Graph Enumeration getEdges() Enumeration getNodes() boolean isMember(Node) boolean isMember(Edge) int […]
Evolution Framework growthe New domains Bug fixes The conflict o o / o Business models Razors vs blades Source Documentation Testing How to test abstract classes? [Make concrete] What’s a test case ? [an application] Software engineering of Frameworks Iteration […]
Growing Frameworks: Beans
What are beans? Bean rules Beans as plugins What are beans? Java Beans are software components. From the Java Beans specification: “A Java Bean is a reusable software component that can be manipulated visually in a builder tool.” The goal of this is to encourage a split in software development: some developers will build components; […]
JavaScript, TCL, Scheme, Python, REXX What Why Approaches Customization dialogs (ui characteristics, toolbar content, etc.) Macros Script languages Plugins Progression Relation to framework Effect on system design Expose “low level” Multiple scriptable languages “End users are not programmers.” Javascript to Java + […]
Exploring dependencies Notation Impact Exercises Break Dependencies Cycles & circular dependencies?? Goal of having a small set of key objects Java packages don’t support other dependency structures directly. Monolithic frameworks A framework is monolithic (“one rock”) when it is constructed such that if you need one piece, you need all pieces. This is the easiest […]
Growing Frameworks: Plugins
What Why vs external program vs source code Mechanics of plugin client Code to interface Move class files to plugin directory Watch it work Mechanics of server Define interface Define directory Load classes Instantiate & call Plugins in Java Consequences […]