design-patterns

Dealing with the lack of closures in Objective-C

Maybe it's just the fact that I've been using http://nodejs.org/ lately, but the lack of closures in Objective-C (iphone) has been really hard to work around. For example, I'm creating service classes. Each service class can have several methods, each of which makes a different URL request. I can use the delegate pattern, but that mean...

"Presenter First" vs "Passive View" MVP?

Is the "Presenter First" MVP pattern the same as the "Passive View"? If not, how do they differ? ...

Book for Anti Design Patterns

I have heard a lot about anti patterns and would like to read a book on this,which book would you suggest for Anti patterns. ...

Java Design questions

Suppose there is a System A which gives some output. This output is used as input by system B. The rate at which System A produces is faster than the rate at which system B consumes it. How can we implement this? The System A sends video at 10mbps where system b can take up only 4mbps.how we can implement this.Also there should be conti...

Conditional Markup in aspx

Hi... I have a ListView. If I want to base the html markup on a condition in respects to the databound item, what would be the best way to do that? What I mean is, is there any other way then putting <% %> if/else blocks directly in the markup? I'm aware that a really ugly way of doing it, is putting html markup in the database field,...

A PHP design pattern for the model part [PHP Zend Framework]

I have a PHP MVC application using Zend Framework. As presented in the quickstart, I use 3 layers for the model part : Model (business logic) Data mapper Table data gateway (or data access object, i.e. one class per SQL table) The model is UML designed and totally independent of the DB. My problem is : I can't have multiple instance...

Factory Method Pattern using Generics-C#

Just I am learning Generics.When i have an Abstract Method pattern like : //Abstract Product interface IPage { string pageType(); } //Concerete Product 1 class ResumePage : IPage { public string pageType() { return "Resume Page"; } } //Concrete Product 2 class SummaryPage : IPage { public string pageType() ...

Is it good, that every PHP class implements a Singleton pattern

Hello, is it good, that every PHP class implements a Singleton pattern? I think, it will be less memory usage because of it. Is it right opinion? Thanks! ...

Taking the data mapper approach in Zend Framework

Let's assume the following tables setup for a Zend Framework app. user (id) groups (id) groups_users (id, user_id, group_id, join_date) I took the Data Mapper approach to models which basically gives me: Model_User, Model_UsersMapper, Model_DbTable_Users Model_Group, Model_GroupsMapper, Model_DbTable_Groups Model_GroupUser, Model_Gr...

Tutorial or book for fantasy sport app design

There are a lot of sites out there that have online fantasy applications. There is also a lot of design that goes into making one of these sites. Does anyone know of a good tutorial or book that covers the basics and gives readers suggestions on how to handle major design patterns. As I work through trying to make one of these apps ...

Java Design Pattern - Business Delegate

Hi I've got some questions regarding Java design patterns. I want to know what the lookup service and the business service in the business delegate pattern are exactly used for. I appreciate as much details and information as possible. thanks in advance! with best regards, Emi ...

How to avoid using this in a constructor

I have this situation: interface MessageListener { void onMessageReceipt(Message message); } class MessageReceiver { MessageListener listener; public MessageReceiver(MessageListener listener, other arguments...) { this.listener = listener; } loop() { Message message = nextMessage(); listener.onMessageReceip...

Architecting ASP.net MVC App to use repositories and services

Hello, I recently started reading about ASP.net MVC and after getting excited about the concept, i started to migrate all my webform project to MVC but i am having a hard time keeping my controller skinny even after following all the good advices out there (or maybe i just don't get it ... ). The website i deal with has Articles, Videos,...

Design Pattern for one-time loaded configuration properties?

I'm often faced with the problem of storing, in memory, a few (possibly complex) configuration settings loaded from files on the filesystem. I'm wondering if there's a better way to architect a pattern to this problem, however, than what I've been using. Essentially, my current solution involves three steps. Build a singleton. Since d...

DAO design pattern and using it across multiple tables

I'm looking for feedback on the Data Access Object design pattern and using it when you have to access data across multiple tables. It seems like that pattern, which has a DAO for each table along with a Data Transfer Object (DTO) that represents a single row, isn't too useful for when dealing with data from multiple tables. I was thinki...

Progress Bar design patterns?

The application I'm writing performs a length algorithm which usually takes a few minutes to finish. During this time I'd like to show the user a progress bar which indicates how much of the algorithm is done as precisely as possible. The algorithm is divided into several steps, each with its own typical timing. For instance- initia...

Elegant and 'correct' multiton implementation in Objective C?

Would you call this implementation of a multiton in objective-c 'elegant'? I have programmatically 'disallowed' use of alloc and allocWithZone: because the decision to allocate or not allocate memory needs to be done based on a key. I know for sure that I need to work with only two instances, so I'm using 'switch-case' instead of a map....

Custom Providers & Design Patterns

Hi. I am using ASP.NET 2.0 and its various providers. I have overridden most of the methods I need and have the following custom providers: ProjectMembershipProvider ProjectProfileProvider ProjectRoleProvider In the design of my project, my intention was to wrap the custom providers in a facade - style design - mixing and matching...

C# Object Pooling Pattern implementation

Does anyone have a good resource on implementing a shared object pool strategy for a limited resource in vein of Sql connection pooling? (ie would be implemented fully that it is thread safe). To follow up in regards to @Aaronaught request for clarification the pool usage would be for load balancing requests to an external service. To p...

MVC Really a Four Headed Pattern?

Is it just me or is MVC really Model-View/Controller-View View-Model/Controller-Model with two distinct controllers? ...