design-patterns

Should I use List[A] or Seq[A] or something else?

I was writing a class that contained some functional-esque methods. First I wrote them using List as parameters and return types. Then I thought "Hey, you could also use a more generic type!" so I replaced the Lists with Seq, hoping that I could make my stuff faster one day by feeding them something else than lists. So which general pur...

Simple 3D app Design Pattern

Im attempting to convert a simple 3D room explorer/configurator app that is a hacky mess into something a little better. I have now begun separating it out using an MVC pattern, but have found a major performance decrease. I think this is down to the Controller updating the camera parameters in the Model, which is then notifying the vie...

ASP.net webform design

I can't figure out a good design for this. I have an edit product page. It allows you to change basic product details, product name etc. Then I have a function to upload images of the product. I also have a small page for adding different prices based on date ranges for the product. What I can't figure out, is how to have these on...

jQuery plugins abuse

Possible Duplicates: Why build Javascript functions as jQuery plugins? Am I using too much jQuery? When am I crossing the line? I am trying to learn jQuery & front-end technologies in general. Right now my point of focus is jQuery. The framework has some really awesome plugins. But at what point does one consider the need fo...

Design Pattern For Syncing Two Applications

Please don't judge me for what I'm doing because I realise it's a bizzare thing to do but my Boss wants it as an internal tool. I needed to Sync the tasks with a Microsoft Project File with an outlook calendar via an outlook add on. The add on takes tasks that don't have any sub tasks and places them in the calendar spanning the time o...

typedef inheritance from a pure abstract base

Edit: Found duplicate I've whittled down some problem code to the simplest working case to illustrate the following: my typedef in a pure abstract base class is not being inherited by the derived class. In the code below I'd like to inherit the system_t typedef into the ConcreteTemplateMethod: #include <iostream> // pure abstract te...

Design pattern for multiple consumers and a single data source.

I am designing a web interface to a certain hardware appliance that provides its own custom API. Said web interface can manage multiple appliances at once. The data is retrieved from appliance through polling with the custom API so it'd be preferable to make it asynchronous. The most obvious thing is to have a poller thread that polls ...

Specification Design Pattern : Writing maintainable Decision Tree type business logic

I was reading the example in this: http://en.wikipedia.org/wiki/Specification_pattern and it seems an interesting pattern. The example can be applied as it is, if the different Specs did not share state or pass on information from one to another. What if each produces some information apart from making the decision that can be reused by...

Better pattern for construction of this object?

I am constructing enum values that have a data structure like the following: enum MetaType { HUMAN( new MetaTypeAttribute(AttributeType.BODY, 1, 6), new MetaTypeAttribute(AttributeType.AGILITY, 1, 6), new MetaTypeAttribute(AttributeType.REACTION, 1, 6) ), ORK( new MetaTypeAttribute(AttributeType.BODY, 4, 9), new MetaTypeAtt...

Is there such a thing as a manager design pattern?

Is there such a thing as a manager design pattern that controls how different entities interact? This is for a project for which the Environment, EnvironmentListener, and Entity classes have been predefined by our professor. The static class, Environment, has a single EnvironmentListener interface that has a nextAction() method it ju...

Requiring unique email while not divulging emails of existing users

On a standard web signup form, users are required to have a unique email for the site. if the email is already in use, a new user cannot be created with that email - but this opens op for exploiting this to find out, what emails are members of the site (at least check if a specific email is in use). Making sure a bot cannot mass-query ...

Save Changes Button

Hi, I'm working on a project about user contributed recipes and connecting them in different ways. One of the things that i used to do without thinking is whenever there is an edit form e.g. whenever the user is editing a recipe, i redirect the user to a relevant page, the Save Changes button would redirect to the recipe page, or the re...

Delegates in python

I've implemented this short example to try to demonstrate a simple delegation pattern. My question is. Does this look like I've understood delegation right? class Handler: def __init__(self, parent = None): self.parent = parent def Handle(self, event): handler = 'Handle_' +event if hasattr(self, handler):...

Forgot Password Patterns or techniques? ¿pattern names?

I friend of mine just posted on Buzz a question: When you hit "Forgot your password" in most of the pages, they will send you an email with a link (most of the time it will expire after sometime) to reset your pass. In most cases that link includes something like a UUID. Is there a name for this technique? Making an expir...

Encapsulation and delegate contravariance - shouldn't it be the responsibility of a programmer to...

1) One reason to use encapsulation is that by hidding internal implementation details we are able to modify this details without breaking the existing code – this makes perfect sense a) But I don't understand the argument that encapsulation should be used in order to prevent users from setting the internal data of an object into an in...

Where to keep validation logic

OK i have seen other posts about this but none really specifically answer my question. Where in an application should validation logic be? I have a small application that allows new products to be instered into an applications database. There are different products with different fields i.e. product name, order number, description etc...

MVC for a UI Heavy App

Is MVC architecture appropriate for an app that is a UI centric app? Example: you want to build a basic flowchart app. Does it make sense to make the GUI components the view, the "node" and "line" objects part of the model, and the click handlers the controllers? It feels weird to me because there is not much functionality in the mod...

Examples of Design Patterns used in JDK

Possible Duplicate: Examples of GoF Design Patterns At an interview a while back I was asked for some examples of Design Patterns within the JDK. Off the top of my head I was able to identify Flyweight - as used in the String pool Singleton - in java.lang.Runtime Iterator - as used on Collections classes Not that many. Wh...

Best practices to design component based asp.net application

Hi all , I am starting to design my own CMS , and i want it to be modular to add more functionality later by me or by any other developer I put my eyes on joomla CMS (very popular ,robust and extensible) I want to make a CMS with asp.net to be just skeleton and all functions are done through components Functions like :- User manage...

what should be the role of Controller in gwt applications implementing MVP pattern ?

I am new to GWT and getting back to programming after long gap...my question is about MVP implementation in GWT, I have gone through the following post and they were quite helpfull, but i still have some doubts http://stackoverflow.com/questions/2056/what-are-mvp-and-mvc-and-what-is-the-difference http://stackoverflow.com/questions/123...