I'm having a bit of a hard time articulating this problem. With different types, what considerations are there for how to organize methods that traverse the relationships to convert to a different type? While being forgiving about the precise modelli
I'm reading someone else's code and they separately increment their for loop counter inside the loop, as well as including the usual afterthought. For example: for( int y = 4; y < 12; y++ ) { // blah if( var < othervar ) { y++; } // blah } Based on
Very often I run into code that logic that should be within business object is repeated everywhere as such: if ( !string.IsNullOrEmpty( Employee.Name ) ) Display( Employee.Name ); where as it should be like this : if ( Employee.IsNameSpecified ) Disp
I am trying to design an income return tax software. What is the best way to represent/store a form with hundreds of questions in a model? Just for this example, I need at least 6 models (T4, T4A(OAS), T4A(P), T1032, UCCB, T4E) which possibly contain
To best describe the question, i'll begin with the following scenario: Suppose i have a poker game: The player is allowed to use credit in order to purchase some goods. If the player executes two purchase orders at the same time (theoretically), two
Lets say I wanted a web page that would represent a zoo. There should be a list of enclosures (about a ten thousand of them) and it should be possible to display it in three ways: all enclosures, only enclosures that the currently logged in user has
My app is now in the beta phase, and when my app catches an unexpected exception, I pop a message, asking the user to nicely send the log file via email manually. Now, I want the user to click the button, and the log file will be send automatically,
I would like to resize a UITextView when the keyboard shows up but I can't seem to do this. I've created a single view with an UITextView in it. In code, I would like to manually resize the height of this text view. I do this: _textView.translatesAut
I believe I'm asking a slightly different take on the perennial question of avoiding code repetition. The setup is fairly standard--a bunch of if statements taking similar actions. Below you'll find a short example. I'm trying to figure out the best
Strategy is a pattern aimed at allowing you to add new (in your case sort) algorithms to your software without breaking the clients of the algorithms. It's an investment in design complexity that will pay off if you need to add new algorithms without
In my design, at the first time, I was designing a factory pattern. But one person recommend use better the bridge pattern. This is my scenario: How to improve my abstract factory pattern? I just want to know which pattern is the best for this scenar
This time, I'm gonna create a math problems. I plan to have a dictionary where the key is Levels enum {Easy, Medium, Hard} and value should contain some configuration about how to create the problems. For example: BinaryProblemConfiguration + Bound1
I was not really sure how to formulate my question, but here is the puzzle I am trying to resolve: if (config.a) myObject = new Object<DummyInterface>(); else myObject = new Object<RealInterface>(); so the task is to create a object with a dum
I'm working on some server/client based application at the moment. The application is multi-threaded, has plugin-support (via dlopen,...) and should work with multiple databases. Now I'm looking for some hints to start the design of the DBI-ABC. Firs
i was wondering if any one can help me with my php-mysql design my current app. (is a more or less survey app) it let users store questions about targeting specific features in other products also saved in other table in database ! for example , a us
I'm creating a JavaScript library. This library will attach itself to one or more div's in an HTML doc. I'd like to attach automatically to make it easy for users to integrate the library. Is there a de facto standard or best practice for how HTML el
There is a small program which takes input from users on a prompt. It takes predefined inputs from the users and executes them. It also displays a number with the prompt indicating the count of the commands : myprompt 1) usercommand1 ... myprompt 2)
I know how to code, but designing aligning positioning is a burden. I tried working with css, with tables, html and asp.net but cannot get the site to a professional level of design. problems like the spacing between rows is too much, sometimes too l
This question is more towards Design and Architecture and I want to know SO Readers think on my scenario. I have a requirement where in my Application should provide other application interface when the user logs in to my application. For example, le
Typically Composition and Aggregation are treated the same? But they are different and the choice which one to use changes a lot? For e.g: I believe aggregation would be ideal for testing. But composition is not. Maintenance of dependencies is a pain
On the twitter home page (not logged in), there a scrolling text in the middle below the logo. How is this accomplished? It stops scrolling when mouseover and also has a popup dialog on relevant text. Thanks, MikeThere is a jQuery marquee plugin that
I'm building a Qt application that needs to use libssh, a SSH client library. libssh (understandably) performs its own network connections, however Qt has its own infrastructure for network connections (QTcpSocket etc). Should I worry about these dif
I would like to obtain the diagram design of a sqlite DB by reverse engineering it, so I can avoid the study of the schema by myself and have an approximate idea of what I am dealing with quite quickly. Do you know of some tool that has this feature?
Why only one overload throws this exception? Little update: I understand that there was a design decision made by framework developers. The question is really why that decision has been made, is there a related design pattern or whatever? Because if
I have a java class which has a static member created using Facade (Singleton). Class A implements InterfaceA { private static DataStore db = DataStoreFacade.getInstance("BDB"); //singleton instance public void save(final String key, final Strin
I'm trying to design a simple cache that follows the following rules: Entries have a unique key When the number of entries in the cache exceeds a certain limit, the older items are evicted (to keep the cache from getting too large). Each entry's data
Aside from the MVVM, as well as MVC patterns for the overall structure of a WPF app, how exactly do you break up the model/controller aspect of an app into subcomponents? The reason I ask is that I have no problem architecting the solution from the p
Class c = new Class( { Prop = "Initial" } ); I have the class above. How would you create a method to modify it? public Class ModifyIt(Class c) { c.Prop = "changed"; return c; } or public void ModifyIt(Class c) { c.Prop = "changed
I'm writing my first WCF service. I decided to write the service just as a DLL to begin with and then aspect the WCF stuff on afterwards which is where I am now. I was advised by the architect that I should stick to a specific format for message obje
A two parter: 1) Say you're designing a new type of application and you're in the process of coming up with new algorithms to express the concepts and content -- does it make sense to attempt to actively not consider optimisation techniques at that s