A design pattern is a general reusable solution to a commonly occurring problem in software design.

learn more… | top users | synonyms (2)

0
votes
2answers
31 views

Prototype pattern in Python

I have the following implementation of the prototype pattern in Python 2.7: def clone (instance): x = object.__new__ (type (instance)) x.__dict__ = dict (instance.__dict__) return x ...
1
vote
1answer
14 views

Most efficient ordering post database design

I have posts table that is has post_order column. I store order of each post in it. when I change the order of a row from 25 to 15, I should update all the row from 15 to end. It's good for few rows, ...
2
votes
1answer
18 views

Is it OK for my domain objects use a factory method, or factory layer, when they need to?

Is it OK for my domain objects to use a factory method, or factory layer, when they need to? I have been trying to get client code to create and inject dependencies wherever they exist, however it ...
0
votes
0answers
17 views

Where to check for mandatory properties in a domain object?

I have a PHP MVC application, and my 'M' has a service layer, mapper layer and domain layer. Where and how should I check to ensure that an object has all it's required properties? It seems to me ...
0
votes
3answers
38 views

Instantiate business entity without losing encapsulation

I have a Customer business entity in Domain project, I want to instantiate it in DomainService project based on its properties. There are business logic that needs enforcement when it is created, e.g. ...
0
votes
2answers
11 views

How to use dummy class for external API at runtime (configurable)?

I need to fetch data from an external API, only accessible via VPN. The development/test machine will not always be able to connect to the VPN. The desired behaviour is to use two different ...
2
votes
0answers
44 views

In general MVC design pattern: What to do about those page specific little classes that don't seem to fit as Models or Libraries

In my current implementaion of the MVC design pattern (demonstrated using PHP and CodeIgniter): Let's say I have a "page" located at "www.mysite.com/blue/page" that is ultimately generated by the ...
3
votes
0answers
51 views

WCF design pattern for website

I am currently doing my first proper technical design for a solution to replace one of our existing solutions. At present we have a variety of websites which nominally do the same thing. However 3 ...
-2
votes
0answers
22 views

Designing of an eCommerce portal [on hold]

Design amazon.com. Make valid and practical assumptions Please let me know your approach to this design questions. Apart from above statement no more information was passed. Probably, interviewer ...
0
votes
2answers
44 views

How does Abstract Factory uses delegation

The difference between Abstract Factory and Factory design pattern is that AbstractFactory pattern uses composition to delegate responsibility of creating object to another class while Factory design ...
2
votes
2answers
40 views

Lesser of two evils when using globals via extern

I'm working with some old code that uses many global variables. I'm fully aware of many of the disadvantages of using global variables, so my question is not about whether I should be using global ...
1
vote
2answers
59 views

Design Pattern for an EEPROM burner

I've built myself a basic EEPROM burner using a Teensy++ 2.0 for my PC bridge, and it's working great, but as I look to expand its compatibility, my code is getting rather hacky. I'm looking for some ...
1
vote
2answers
28 views

Regex extract encoding type from given strings

following a recent thread in stackoverflow, I'm posting a new question: I have several strings from which I want to extract the encoding type. I'm willing to do it using regex: Examples: utf-8 ...
-2
votes
0answers
20 views

Backend design supporting web as well as Mobile application [on hold]

What should I keep in mind while designing the backend which supports both a website as well as a mobile application, such that it would handle requests from the web platform as well as requests from ...
-1
votes
0answers
9 views

Object Detection in iOS [on hold]

Hi I am trying to figure out how to recognize objects in an image in iOS. Basically I want to be able to take a picture of a pedestrian crossing and detect if the man is red or green (i.e. if it is ok ...

1 2 3 4 5 889
15 30 50 per page