开发者

C++ class design patterns in open source projects

I have recently st开发者_如何学Pythonarted learning design patterns. I have understood the basics of few patterns. Now I want to get familiar with some real code examples where these patterns are being utilized. Can somebody here please point out to some open source projects where design patterns are being used ? I would like to see how design patterns are being used in real world code.


Following are some of the links. JUnit Cookbook provides brilliant example of quite a few patterns - really worth checking.

  1. JUnit Cook's Tour
  2. Vince Huton's DP
  3. Design PAtterns

Hope that helps.


Well, this is tooting my own horn a bit, but an Open Source project I'm working on makes extensive use of the factory method pattern. I implement the guts of the pattern itself here as a set of templates, define a factory here, register a subclass for that factory here, and use the factory to instantiate objects here.


IMHO, ACE (Adaptive Communication Environment) can be a good example. It also uses c++ templates with design patterns, which is also pragmatical. This framework takes basis of Pattern-Oriented Software Architecture: Patterns for Concurrent and Networked Objects book, which is also a good reference for design patterns, besides GoF


In the book by GOF which you are probably reading, for each Design Pattern they provide a REAL code example, I mean not the sample code, but they actually say in which projects each DP has been used. Those projects are mostly OpenSource. HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜