design-patterns

Problem implementing Interceptor pattern

I'm attempting to develop an Interceptor framework (in C#) where I can simply implement some interfaces, and through the use of some static initialization, register all my Interceptors with a common Dispatcher to be invoked at a later time. The problem lies in the fact that my Interceptor implementations are never actually referenced by...

design pattern compose or inherit?

Most people prefer compose to inherit, but what's the significant benefit for doing so? ...

Where do I find good material on the Observer design pattern?

Where to find good material to study observer pattern? I need some examples, of code and also pictures of modelled situations ...

What is the best way to show A4 booklets in iPhone application?

I need to show some booklets (designed in A4 format) in the iPhone application. I suppose to use UIScrollView with possibility to scroll up / down and zoom in / out. Are there another ways to show such content in comfortable to user way? ...

Good design pattern for running a process on a collection of data?

Best explained with code I think, this is just a simple example: public class MyPOJO { public String name; public int age; public MyPOJO(String name, int age) { this.name = name; this.age = age; } } public class MyProcessor { public List<MyPOJO> process(List<MyPOJO> mypojos) { List<MyPOJO>...

Options for keeping models and the UI in sync (in a desktop application context)

In my experience I have only had 2 patterns work for large-scale desktop application development when trying to keep the model and UI in sync. 1-An eventbus approach via a shared eventbus command objects are fired (ie:UserDemographicsUpdatedEvent) and have various parts of the UI update if they are bound to the same user object updated ...

How can I refactor this to work without breaking the pattern horribly?

I've got a base class object that is used for filtering. It's a template method object that looks something like this. public class Filter { public void Process(User u, GeoRegion r, int countNeeded) { List<account> selected = this.Select(u, r, countNeeded); // 1 List<account> filtered = this.Filter(selected, u, r...

USE case to Class Diagram - How do I?

Hi, I would like your guidance on how to create classes and their relationships (generalization, association, aggregation and composition) accurately from my USE case diagram (please see below). I am trying to create this class diagram so I can use it to create a simple online PHP application that allows the user to register an accoun...

[Zend_View] Tabs contain object (embedding documents)

Hi, My project is based on MVC architecture and I have a UI design pattern problem. I have several tabs which contain object as show in the picture. My first idea was to link a tab to one view (phtml) so in the document each tabs is an embedding document. The tab contains an element with an url to a page. I show you a piece of code. T...

MVC alternatives: examples of MVA & AVC?

I'm interested in learning about the alternative patterns to Model-View-Controller, specifically the Model-View-Adapter and Application-View-Controller patterns. Google results tend to be either a high-level overview or Java-based. Can anyone either provide, or point me to, an example of these patterns in either PHP, Python or JavaScr...

Deciding Development life cycle.

How to decide software development process for developing a software, what are the key factors to be considered while deciding which development process to follow(e.g Agile,WaterFall,Spiral...). ...

Composite Pattern

I have question regarding composite pattern. Is the base class "Component" act like a pointer to point leaf object in "Composite" class? Edit: Let me ask my question in following words. "What is the relation between Composite and Component class?" Here is the uml class diagram of the pattern. ...

Data matching algorithm

Hi all, I am currently working on a project where I a data matching algorithm needs to be implemented. An external system passes in all data it knows about a customer, and the system I design has to return the customer matched. So the external system then knows the correct id of the customer plus it gets additional data or can update it...

Business Logic Layer Pattern on Rails? MVCL

That is a broad question, and I appreciate no short/dumb asnwers like: "Oh that is the model job, this quest is retarded (period)" PROBLEM Where I work at people created a system over 2 years for managing the manufacture process over demand in the most simplified still broad as possible, involving selling, buying, assemble, The system i...

Which book should I pick to improve my program designs/design patterns?

I want to learn about design patterns and from what I've seen the most recommended ones are the Gang of Four's Design Patterns and Head First Design Patterns. There are also language specific books, but I never see them recommended. I suppose it ties you to whatever strengths/weaknesses are inherent to each language, so not a good idea t...

Domain driven design: Manager and service

I'm creating some business logic in the application but I'm not sure how or where to encapsulate it, I've used the repository pattern for data access, I've seen some projects that use DDD that have some classes with the "Service" suffix and the "manager" suffix, what are each of this clases suppose to take care of in DDD? ...

Question regarding factory pattern

I have a factory class to build objects of base class B. The object (D) that uses this factory receives a list of strings representing the actual types. What is the correct implementation: the factory receives an Enum (and uses switch inside the Create function) and D is responsible to convert the string to Enum. the factory receives a...

Implementation of Event Aggregator in asp.net

I want to use Event Aggregator to allow communication between presenters on the page. I am using currently this implementation http://kentb.blogspot.com/2008/03/event-hub.html. But in asp.net I am not sure about side effects which can occur. ...

Nice name for `decorator' class?

I would like to separate the API I'm working on into two sections: 'bare-bones' and 'cushy'. The idea is that all method calls in the 'cushy' section could be expressed in terms of the ones in the 'bare-bones' section, that is, they would only serve as convenience methods for the quick-and-dirty. The reason I would like to do this is tha...

UML Class Relationships

Hi, I would like to confirm whether I am on the right track when identifying common UML class relationships. For example, is the relationship between: 1 a stackoverflow member and his/her stackoverflow user account categorized as a composition relationship or an aggregation relationship? At first I thought it was an association because ...