strategy

A company that had a successful product but went bust for not innovating?

At the company that I work we have a successful software product that did well but is now obsolete and unmaintainable. I am trying to explain that you need to innovate and replace this product with new offering in order to survive. I am looking for some good examples of companies that made the mistake that we are close to making - relyin...

TDD with Strategy Pattern

I'm trying to implement the strategy pattern using TDD. Each strategy item implements an interface. What's the best way to do this with TDD? Do you have to create a test fixture for each implementation of the interface testing the same methods but on each implementation? Any articles detailing the approach to take would be gratefully w...

Best strategy for synching data in iPhone app

I am working on a regular iPhone app which pulls data from a server (XML, JSON, etc...), and I'm wondering what is the best way to implement synching data. Criteria are speed (less network data exchange), robustness (data recovery in case update fails), offline access and flexibility (adaptable when the structure of the database changes ...

How to ignore GUI as much as possible without rendering APP less GUI developer friendly

The substance of an app is more important to me than its apperance, yet GUI always seems to dominate a disproportionate percentage of programmer time, development and target resource requirements/constraints. Ideally I'd like an application architecture that will permit me to develop an app using a lightweight reference GUI/kit and foc...

Strategy for lazy-loading markers into a Google Maps Javascript API map

I'm building an ASP.NET MVC site where I want to have a Google Maps Javascript API map that shows markers loaded from my backend through AJAX. As I don't want the client to run into memory issues, I want to lazy-load the markers and apply them to Fluster2 to put them into clusters. I think the best way to lazy-load the markers is to add...

.Net - Strategies to avoid magic string

In the code where I work, we got many think like that : if (user.HasRight("Profile.View")) {} So, there is many place where we pass a string as parameter to see if the user have a specific right. I don't like that because that generate a lot of magic string. What would be a better way of doing it ? Enum, Constant, class ? ...

Doubts regarding Enum Strategy approach

For computing Income Tax, I tried to use Enum Strategy approach to make the logic more concise. But in the end I’m not satisfied mainly because I had to write different enums for income groups, limits and rates. This was because they are all constants of different nature. But due to this the code doesn’t looks compact and seems to lack e...

Coding strategy for securing sensitive data

A web application contains sensitive data of the users. Neither the operator of the web application nor the hosting provider should be able to see this data. Therefore I wanted to store these data in the DB encrypted with the entrance password of the users. dataInDB = encrypt (rawData, user password) With this strategy it is however...

Select dropdown element with 1 million options, ahem...dependent too

Say we have three dependent select dropdowns (selecting parent asynchronously populates the child via a database query): DD1: [People of this world]     DD2: [Hair Strands]         DD3: [Keratin Molecules] Ok, our options' lists won't be as large as what the names here imply, but each dropdown is going to house about 1 million option i...

Strategy for supporting international keyboards in Flash/Flex

I have an Flash/Flex application that is showing weird behavior when used in conjunction with international keyboards. For example, I have extended TextInput in this app to allow for special behavior when the user presses the hyphen ('-') key. When this happens I want the text of the input to be padded with zeros in addition to the typ...

model and view in a simple strategygame with cocos2d&cocoa touch

Hey i need some general advice on how to structure my project. i am trying to make a simple strategygame where some object move around in a "worldspace" and youve got several different tactical views, which show diffent areas of the game. nothing special. but since i'm a rather unexperienced programmer, some things are not quiet clear to...

What is the recommended strategy of complete refactoring of a live product?

Hi, Consider that you have "System_A" which is a web application. And System_A has simply 3 layers: UI, BusinessLayer and Data-Layer. And now you want to make a widespread refactoring of System_A (the UI and BusinessLayer only) meanwhile that is working as a live product. What should be the safest strategy of refactoring System_A and ...

Is there an easy way to define a common interface for a group of unrelated objects?

I've got a class that serializes data. I may want to serialize this data as JSON, or perhaps YAML. Can I cleanly swap YAML for JSON objects in this case? I was hoping I could do something like the following. Is it a pipe dream? FORMATS = { :json => JSON, :yaml => YAML, } def serialize(data, format) FORMATS[format].serialize(data)...

Advice for dealing with code maintenance

Hi guys, I've been working at my university this summer in an image/video lab. Just recently, my professor gave me a program written by a grad student who just left the program to "fix up", because it was "giving some errors." The project was written in C++ (seems to be a recurring bad sign in student code). I opened the project in VS0...

How to set up Spring Security SecurityContextHolder strategy?

Hi, I'm using asynchronous methods in my service (Spring 3 @Async annotation). And I've got a problem - spawned thread doesn't have security context. Cause of it is Spring Security by default uses SecurityContextHolder.MODE_THREADLOCAL strategy for its context holder. But I need to use SecurityContextHolder.MODE_INHERITABLETHREADLOCAL s...

Drupal strategy related question

Hi, i've a Drupal theory/strategy related question. First i want to say that i'm very new to the drupalling world, so this question can be quiet stupid. I'm trying to develop/make a part of a site that has the following structure: (level one) virtual_exhibitions: shows an overview of exhibition categories. (level two) themes, places, p...

Git Merge Recursive Ours - Command Syntax Example

What is the right format for a git merge with a strategy of recursive ours? (not to be confused with the git merge ours strategy) http://www.kernel.org/pub/software/scm/git/docs/git-merge.html I tried a bunch of ways and it doesn't seem to work. git merge foo -s recursive-ours // doesn't work git merge foo -s recursive ours // doesn...

Strategies to handle a file with multiple fixed formats

This question is not Perl-specific, (although the unpack function will most probably figure into my implementation). I have to deal with files where multiple formats exist to hierarchically break down the data into meaningful sections. What I'd like to be able to do is parse the file data into a suitable data structure. Here's an examp...

What would you advice to a development team which is moving to a new technology?

Hi, What would you advice to a development team that is about to move to a new technology (Let's say from asp.net application to SilverLight where no one in the team has an experience so far on SL development, or for a similar case)? How should be the learning, experiencing, planning, development and other phases should be orchestrated...

Custom Hibernate NamingStrategy with singularized foreignkeys of many-to-many's

Hello! I'm trying to implement my own Hibernate NamingStrategy based on the ImprovedNamingStrategy. This is quite nice... only the foreign keys of many-to-many relations are ugly. Example scenario: public class Teacher { @ManyToMany private Set<Course> courses; } public class Course { @ManyToMany private Set<Teacher> ...