Re: Observer Design Pattern



Robert Martin wrote:
On 2006-05-31 06:00:00 -0500, "Krivenok Dmitry" <dima@xxxxxxxxxxxxxxxxxx> said:

Hello All!

I am trying to implement my own Design Patterns Library.


If you are talking about a code library (as opposed to a library of documents) then I'd like to discourage you. Design Patterns are not the kind of thing that you can turn into a reusable coding library.

Observer is one of the exceptions to this rule; but it's only a partial exception for the reasons that you have already pointed out in your post.

<snip>

# Ruby
require 'singleton'
class Logger
include Singleton
end

Logger is now a singleton class. Is that one of the exceptions?

Joe
.



Relevant Pages

  • Re: win32 design patterns
    ... The "fact" that exceptions lead to reduced code size is a myth. ... As for two-phase initialization - this is not an anti-pattern. ... What are "Win32 design patterns"? ...
    (microsoft.public.vc.language)
  • Re: Singleton --- almost
    ... >>design patterns to apply, instead of trying to judge which design patterns are ... The structure of the Singleton ... If the service object is not a singleton, ... we could create a singleton renderer object and assign it to a column, ...
    (comp.lang.java.programmer)
  • Re: Singleton --- almost
    ... >>design patterns to apply, instead of trying to judge which design patterns are ... The structure of the Singleton ... It may be useful to have a registry of particular objects used by ... objects using the class to adopt an effective usage strategy. ...
    (comp.lang.java.programmer)
  • Re: The Singleton Pattern in PHP 5
    ... >> To add to my growing library of Design Patterns in PHP 5 I have ... >> written what I think is a good example of the Singleton Pattern. ... >You have a class (BookSingleton) with a public constructor, ... >To solve this problem, you need to make the constructor private, and the ...
    (comp.lang.php)
  • Re: Any relation between COM component and Singleton class???
    ... "Design Patterns" by Erich Gamma et al, ... Singleton is one of the creational patterns. ... Alexander Nickolov ... Microsoft MVP, MCSD ...
    (microsoft.public.win32.programmer.ole)