The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
52 views

Creating/updating entity save strategy

Please note: although I'm talking about Java in this question, what I'm asking about here should really be language-agnostic. I am dabbling in OR/M for the first time, and have cooked up the ...
0
votes
1answer
42 views

How to organize conversion logic for strategy pattern?

I have a Color class. It has a property model which is a class that implements ColorModel interface, this property could be a RGB, Hex or HSL classes which implementing ColorModel interface. // ...
0
votes
1answer
72 views

How to compute data for charting?

I'm building a charting component that displays data directly from the raw data records. It should be able to filter data (subset) and then perform some rudimentry maths on the data (sum, avg, etc). ...
0
votes
1answer
75 views

Strategy vs Publiser-subscriber pattern

Let's say I have a channel endpoint where I receive messages. Because I want to process messages in a different way depending on its Header property, rather than create a massive switch I create ...
3
votes
2answers
194 views

Strategy game, how do I calculate the parallel actions?

I am building a strategy game where multiple units(5 - 20) fighting each other. I have a game logic that calculate all the actions that been done on each turn, and send it to the game engine to ...
2
votes
2answers
214 views

What do I gain by using the Strategy pattern in this case?

I wrote a program with Java that plays simple music. Currently chords have only one way ('strumming pattern') to be played. I want to expand this and create different 'strumming patterns' that chords ...
0
votes
1answer
133 views

MVC: Where should I store interchangeable algorithms used by the Model (whose names also need to be accessible to the View)?

Please consider a program, where the user chooses an algorithm from a list, and the Strategy pattern is utilized to set this algorithm as the model's operation. For example, an image procession ...
0
votes
1answer
113 views

Is it better to pass the whole object or use a setter?

Here is my initial code that I would like to modify by using strategy design pattern. class Bar { int a; int b; ... } Class Foo { Bar *bar; bool action1(){ // this function does a ...
0
votes
1answer
292 views

Implementing a strategy pattern with dependency injection

Okay, so the goal here is to implement a strategy pattern that can be tested using any sort of automated testing tool. I've been struggling with this problem conceptually for a few weeks now and I ...
1
vote
2answers
99 views

Inheritance vs 'specification' by fields

I'm currently reading 'Head first design patterns', and already the first chapter threw some questions towards me. This chapter introduces the 'prefer composition over inheritance' design principle, ...
1
vote
1answer
183 views

Image strategy on Android

I am creating an application with lots of photos. They will take > 100 mb on memory. So far I have 3 ideas: Place it in @drawable - app will be heavy Download by JSON and place in java ...
0
votes
2answers
372 views

Strategy with using SVN to switch between test and production server. (with maintaining configuration files)

I would like to know your opinion about my setup right now, how I do things with SVN and if you could find some better solution for me. I'd appreciate it very much if someone could come up with some ...
3
votes
2answers
2k views

Is context inheritance, as shown by Head First Design Patterns' Duck example, irrelevant to strategy pattern?

In Head First Design Patterns it teaches the strategy pattern by using a Duck example where different subclasses of Duck can be assigned a particular behavior at runtime. From my understanding the ...
2
votes
2answers
354 views

Best strategy in SQL

Recently, a colleague told me that it wasn't advisable to make conditions in the join clauses. Instead he suggested to make conditions in the where clause. He told me that the SQL engine was optimized ...
0
votes
1answer
164 views

How to handle “animated” game where the visual should “animate” instead of abruptly change?

I've been playing around and learning javascript/KineticJS by making some simple games (think like board games). I have the game model that is relatively logically simple. When a "move" is given to ...
0
votes
1answer
224 views

Do integrated systems increase development time and cause inflexibility?

I work for a large financial company that manages money for thousands of clients. This company has very complex business processes and they operate in a very dynamic environment. This is a fairly ...
4
votes
2answers
1k views

Context class in Strategy pattern

I'm trying to understand the strategy pattern and asking myself: is the context class must-have or can I leave it out without compromising pattern's purpose ? I was under the impression I needed some ...
1
vote
3answers
332 views

Where to check that a function actually did what I told it to?

Consider this function intended to kill all running instances of a subprocess: killAllFoobars() { pids = getRunningFoobars(); foreach ( pids as p ) { killOneFoobar(p); } ...
2
votes
1answer
489 views

Liskov substitution and abstract classes / strategy pattern

I'm trying to follow LSP in practical programming. And I wonder if different constructors of subclasses violate it. It would be great to hear an explanation instead of just yes/no. Thanks much! P.S. ...
0
votes
1answer
368 views

would a composite design pattern be useful for group membership?

I'm trying to think about the best way to handle group memberships on a website. People sign up and select checkboxes in a list of interests. Every week we send out interest-themed emails to those ...
1
vote
1answer
398 views

Linking application build number to svn revision

I am looking for a strategy to version an application with the following requirements. My requirements are given an exe with version number (major.minor.build-number) 1) I want to map the version to ...
2
votes
8answers
1k views

Strategy/algorithm to divide pot to chips

I want to split poker pot to chips. Example: Pot = $17.500. I have the endless piles of chips. I have the following types of chips: ChipsTypes = [$1, $5, $10, $25, $100, $500, $1.000, $5.000, ...
2
votes
2answers
1k views

Strategy vs Delegates

Can the Strategy design pattern entirely replace delegates? In Java, for example, there are no delegates. Is it possible to gain all the features of delegates by using Strategy design pattern? ...
16
votes
8answers
2k views

Strategy/algorithm to divide fair teams based on history

We are a group of people playing floorball together on a regular basis. Every session starts with the daunting task of dividing teams... So what would be better than an application to pick teams ...
6
votes
6answers
2k views

Can the Strategy pattern be implemented without significant branching?

The Strategy pattern works well to avoid huge if...else constructs and make it easier to add or replace functionality. However, it still leaves one flaw in my opinion. It seems like in every ...
0
votes
2answers
545 views

How do I share common classes between windows forms and web applications using C#?

In our environment we have multiple ERP servers plus data that are coming from multiple sources. I need to create a development roadmap for the coming years as it is obvious that side applications ...
4
votes
3answers
691 views

Can you point me to a nontrivial strategy pattern implementation?

We are faced implementing a registration workflow with many branches. There are three main flows which in some conditions lead to one another. Each flow has at least four different steps; some steps ...
3
votes
2answers
595 views

Adding more responsibilities to Activities in a flexible way

I am considering how I can add tasks to Android Activities in a flexible way. I can only use implementation inheritance for one thing in Java and I would like to use it, if I use it at all, for ...
1
vote
1answer
486 views

Best Practice: strategy regarding Website Projects and versioning

What are the best practices and strategy for designing and developing a website? The key parts I want considered are: DLL deployment IIS publishing project versioning namespace Please answer ...
2
votes
1answer
102 views

Is it OK to pass the concrete client to a method on the concrete strategy?

When using the strategy pattern, is it good practice to pass this to a method on this.strategy? I have a strategy interface with one call, TakeAction. The idea is that TakeAction decides which of ...
6
votes
2answers
4k views

Trial/Free & Full Version VS. Free App + In-app billing?

I'm just wondering what would be the best strategy to publish an application on the Android Market. If you have a free and paid version you have two codes to update (I know it will be 99% the same ...
4
votes
3answers
3k views

Starting a new startup/web application, how to choose a hosting provider? [closed]

When creating a new startup related to a web application, how to choose a hosting provider ? Assuming the code of the web application is oriented DDDD (Distributed Domain Driven Development) to ...
3
votes
4answers
950 views

Can the strategy pattern be overused?

Example: A file, representing a serialized version of an object, needs to be read and deserialized. It would simple to implement this if we only cared about a single serialization format, but many ...
1
vote
2answers
130 views

Path of Replication

I'm currently developing a replication system to keep data in-synch between an arbitrary number of servers. Some of these servers exist in one cluster on one LAN. Others exist somewhere else in the ...
17
votes
5answers
4k views

What is your application versioning strategy? [duplicate]

I would be interested to get the SO community's opinions on the best application versioning strategy. My questions: How do you keep track of your application's version number? Do you have a formal ...
11
votes
6answers
951 views

How productive is an excellent developer compared to an average one? [duplicate]

I believe that I read somewhere that Google has a rule of thumb that an excellent developer is around 300 times more productive than an average one. Does anyone have any rules of thumb used by large ...
9
votes
5answers
1k views

Modified Strategy Design Pattern

I've started looking into Design Patterns recently, and one thing I'm coding would suit the Strategy pattern perfectly, except for one small difference. Essentially, some (but not all) of my ...
5
votes
3answers
359 views

Hashing growth strategy

What is a good growth strategy for hash tables? If the number of elements exceeds the number of buckets, I increase the number of buckets with the following formula: n = int(n * 1.618033988749895) | ...
22
votes
14answers
1k views

How managers choose programming languages

It's not a secret to anyone that managers can and often will impose the programming language that will be used for a project. Being a programmer myself, I have never been able to understand this. ...