Is there a design pattern that deals with callback mechanism?

That would be the Observer Pattern – From Wikipedia The observer pattern (a subset of the asynchronous publish/subscribe pattern) is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It … Read more

What is a Domain Model

Basically, it’s the “model” of the objects required for your business purposes. Say you were making a sales tracking website – you’d potentially have classes such as Customer, Vendor, Transaction, etc. That entire set of classes, as well as the relationships between them, would consititute your Domain Model.

Callback/Command vs EventListener/Observer Pattern

Command, callback and observer patterns have different semantics: callback – notifies a single caller that some operation finished with some result observer – notifies zero to n interested parties that some event (for example a finished operation) happened command – encapsulates a operation call in an object thus making it transferable over a wire or … Read more

DCI – Data, Context and Interaction – Successor to MVC?

Trygve makes a presentation of DCI in https://vimeo.com/8235394 DCI has been created to solve a problem in object orientation: it’s too difficult to review OO code. The code for one use-case in OO is typicall spread out between lots of classes. To understand how the code works, you must also know the relationships between objects … Read more

Design patterns: Composite vs. Composition

Composition This is a design concept (not really a pattern). This term is used when you want to describe one object containing another one. It occurs very often in Composition over inheritance discussion. Moreover, composition implies strong ownership. One objects owns (i.e. manages the lifecycle) of another object. When parent is destroyed, all children are … Read more

Factory Pattern – CreateInstance static or not?

I’m very hesitant to categorize “instance versus static” as a matter of taste. This sort of implies that it’s aesthetic like a favorite color or, more appropos, camelCase versus PascalCase. Instance versus static is more a question of tradeoffs. With instance members of any kind, you get all of the benefits of polymorphism, since you … Read more

Transaction script is Antipattern?

Transaction Script is definitely not an anti-pattern. From what I find about Transaction script, it is not object-oriented at all. You are right, it is not, indeed. That fact however doesn’t make it an anti-pattern. Although it is a procedural approach, indeed, it still has its right place in the series of business logic architecture … Read more