Organize methods by type of return or argument?

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

How should I design my CAD layer

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

Log files for collection and management of the system?

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,

Move in similar repetitions in if statements

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

Why the plant is insufficient for sorting

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

Bridge or factory model?

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

Has good practice left an empty interface?

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

create objects from a model class with a different type

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

Best point to start developing a database interface in C ++?

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

php: Mysql Database Design and Workflow, need more creativity!

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

Problems with website design with tables and css

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

Is not the composition bad for testability?

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

How to scroll the text on the Twitter homepage?

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

How strict is it when using the Qt framework?

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

What tools are available to reverse a sqlite database?

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?

Testable design

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

Great Application Design (WPF / Silverlight)

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

Do you prefer to return the modified object or not?

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

WCF: MessageContract, DataContract and hellip; Confused?

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