Introduction to Design Patterns
Seminar:
We start with a short introduction to design patterns. The main resources like c2.com are explained. After that everybody picks one or more patterns which she will demonstrate in a short presentation. Experienced students usually pick more architecture level patterns like frameworks (EJB, J2EE) or system oriented pattern for concurrency and distribution. Not so experienced students select patterns from the "Gang-of-four" (GOF) book.
Demonstrations start with simple patterns from GOF. This way we lay a foundation of standard patterns. You will quickly recognize that they show up in many more complicated architectural patterns later on.
Here is a short list of topic we have covered:
Patterns describing frequent mistakes like the big ball of mud, god classes, analysis-paralysis. Interestingly every anti-pattern as a strong social or organisational component. Real life experinces make for a lively session. BTW. There are several books on anti-patterns like "Anti patterns", "Bitter Java" etc.
With J2EE desing being so popular this session tries to cover the major pitfalls and workarounds in the EJB area. Some architectural desing problems from J2EE itself like the connector architecture are also dealt with. There are good books available. Look at the resources section in the session on J2EE.
We had several session on advanced frameworking where generative approaches e.g. for OO-relational mapping or Value Object generation where shown. Sometimes students bring frameworks from their company and we have a look at them. E.g. a game framework or an EJB tooling framework.
Narrative and gestural patterns used in game designs to communicate events to the user. Very nice. Proof of patterns being truly universal
We have discussed plug-in technology, e.g. 3dstudiomax and how patterns help in this area (template-hook, adapter etc.) I'd love to take a look at the eclipse plug-in technology. Michael Taege is using it heavily in his diploma project and will give us a talk.
Model-view-controller, observer to MOM systems, GUI patterns and idioms. Next session a student will bring a particulary ugly piece of code which we will try to refactor. Feel free to bring your own monsters.
I am looking for a good piece of demonstration code that either can be refactored easily using patterns or which already contains easily detectable patterns. Some students want to get practical and I can understand them. Unfortunately the short seminar time leaves litte room for it.
Non-technical Patterns:
I had lots of fun lately with an issue of cryptogramm. Schneier mentioned an article that described the patterns of explanation used by criminal profilers as cold reading patterns. In other words: language pattens destined to create vagueness and to avoid being caught with a wrong statement? Who would have thought that profilers use those?
Looks like the "soft" sciences are getting more and more important in computer science. Usability needs a lot of psychology. Security needs a lot of psychology as well. As IT is becoming truly ubiquitous knowledge of the patterns of political manipulation is becoming more and more important.
New Ideas for this Term:
I have got a lot of ideas for this term: Spring and its new style of handling context through dependency injection and inversion of control needs to be investigated. We will be more critical of patterns as well: show that behind many iterator/visitor patterns is simply the need for higher-order function support which is still missing in many OO languages. Prototype concepts need to be known better. We will discuss "Emancipating Instances from the Tyranny of Classes in Information Modeling by JEFFREY PARSONS and YAIR WAND in the context of data access patterns. The observer pattern can be used to show the evolution of a simple (and not really implementable pattern) into high-speed event mechanisms and enterprise message bus technology. Java NIO is still not mainstream knowledge of many developers and we need to show the differences compared to the old mechanism. Can design patterns form an executable language? see the discussion at Design Patterns as Higher-Order Datatype-Generic Programs. Jeremy Gibbons (2006).
The huge number of participants again forced a change in style and content. The hopes for fewer participants have not come true as we are right now in the middle of the diplom/bachelor/master change. This cannot be helped and we will try our best. This is what I would like to do:
For a first participants which pick a pattern for presentation will have to show its use in some software project - preferably from Sourceforge. This way students will learn how to deal with source code AND concentrate on the architectural solution that is provided through the specific pattern..
A next step would be to focus primarily on the problem aspect and let the students decide which patterns they would use to solve a problem. This would mean we need not a list of patterns but a list of specific problems, e.g. when and how to use "context" or when and how to achieve decoupling between objects, components etc. At the end we would get another catalog. This time not on patterns but on complete architectural solutions for standard problems. One could perhaps call this a catalog of applied pattern systems.
Another idea is to focus on eclipse only and uncover all the patterns used in its architecture.
And finally a list of patterns I would like to see explored better:
System Patterns (concurrency etc.) from operating system and server designs. Especially the New I/O patterns in Java (Unix select etc.) are important.
Patterns used in enterprise application design (e.g. based on Ted Newards new book on enterprise java architectures).
Social patterns and patterns form other areas (like game design, movie making, animation, story telling). This could fit nicely together with topics from our sister faculty audiovisual media.
Performance Patterns. What makes software fast? Java performance myths.
Architectural Meta-pattern (like the system design guidelines from Butler Lampson). Not to confuse with architectural patterns
Complex architectural patterns like bureaucracy. The patterns behind application servers. Resource Management patterns.
Lifecycle patterns and everything to do with managing the lifecycle of software or objects.
Generational Patterns from Bettin/Voelter. How to model and generate. With process instructions.
Special security patterns: isolation, closure, inversion of control. What could we do to make browsers safer?
Event based patterns: active objects (Symbian OS) vs. threads.
Data access patterns from the book with the same name. Something new in O/R mapping world?
Extension Patterns: how to extend software (interceptors, virtual adapters, plug-ins, hot configuration)
high-end business patterns (mandantenfähigkeit, bi-temporal storage, stellvertreter)
Communication patterns (transport, format, communication)
Context pattern(directories, parameter, environmental acquisition, inversion of control, closures)
This was last term
I guess I am going to change the seminar slightly. After the usual first phase of introducing a number of basic patterns I'd like to dig into eclipse source to show the patterns in action. How is extensibility realized? How does observer work in eclipse? etc. Base will be the new book by Erich Gamma et.al. on Eclipse. It does not provide much more than the web information on eclipse but it structures and brings order to the whole. The section on patterns is especially nice.
I also like the "rule" approach in this book and would like to discuss it with the students.
Other things I'd like to touch this term:
Environmental acquisition - concept and implementation
Generative patterns
Architectural patterns like the Java Connector architecture
A glance at prototype based languages to break the C++/Java mold.
Perhaps some bits from the book "data model/access patterns" which I got for the library last term.
I don't want to promise too much at that time but I will try to get Claus Gittinger, on of the worlds leading smalltalk experts who happens to be an old friend of mine to join us for a session on patterns and architectures in other languages
Design and Architecture Issues
A discussion of architecture problems and how they can be solved.
Some tips if you need to design a new API e.g. for bluetooth wands.
Sometimes a student comes back with a thesis and the result is a real surprise. Or what would you say if the result is that none of over a hundred standard software packages for project management would be fit for his company?. I started a small article series on the reasons why software doesn't adapt. It will also cover the open source project www.eclipse.org as an example of adaptive software.
Learn which changes break compatibility and how to avoid this. What is the advantage behind abstract base classes as default implementations and not letting customers derive from interfaces directly? If you don't know - read the article.
Learn which changes break compatibility and how to avoid this. What is the advantage behind abstract base classes as default implementations and not letting customers derive from interfaces directly? If you don't know - read the article.
If you thought that OO and Java must be slow - learn to apply design patterns for performance and still produce extensible software.
Mirrors: Design Principles for Meta-level Facilities of Object-Oriented Programming Languages Gilad Bracha, David Ungar Sun Microsystems
The term is almost over and you are desperately looking for some computer science book to read at the beach - if they weren't so darn expensive. Get this classic from Richard Gabriel for free.
Hints for Computer System Design Butler W. Lampson Computer Science Laboratory Xerox Palo Alto Research Center Palo Alto, CA 94304
Dependendy Inversion Principle by Robert Martin (C++ Report)
On observer and message patterns
Event Systems How to Have Your Cake and Eat It Too P. Th. Eugster1, P. Felber2, R. Guerraoui1, S. B. Handurukande1, 1 Distributed Programming Laboratory, Swiss Federal Institute of Technology in Lausanne. 2 Bell Labs, Lucent Technologies, 600 Mountain Ave,
Java Event Delivery Patterns, Paul Monday