design

TDD: Does it get in the way of good API design?

I've never written TDD code, but I've seen a decent amount of discussion about it here on SO. My biggest concern with it is that it seems like general good API design (for flexibility, ease of use, simplicity of interface, and performance) takes a back seat sometimes to making code mockable, ultra-modular beyond what is necessary for an...

Decorator Design Pattern

Hi, I have been looking at the decorator design pattern (I am new to the subject of design patterns), and I was wondering, Can a decorator interact with more than one component? If A is a decorator of component B, can A have operations that B does not have? Thank you. ...

Design principles for complete noobs?

I've been programming for around a year now, and all the stuff that I've written works - it's just extremely poorly written from my point of view. I'd like to know if there are any (free) good books on Software Design out there that can offer a little guidance to the beginning programmer? I don't think I'd have as many problems if I knew...

Convert from tailf XML DB to SQLite DB

I have a project which is composed of a board with 2 CPUs that have access to 2 different memories (FLASH and DDR), and the 2 CPUs can communicate by ethernet among themselves. one CPU is running XML hierarchical DB files handled by "tail-f" and the other is running SQLite DB and also a CLI which is exposed to the user through which he...

How to design this "bus stations" database?

I want to design a database about bus stations. There're about 60 buses in the city, each of them contains these informations: BusID BusName Lists of stations in the way (forward and back) This database must be efficient in searching, for example, when user want to list buses which are go through A and B stations, it must run quickly...

Access control for a services (design decision)

Hi, Let's say we have an interface 'IA' for which we have an implementation 'A'. In our application domain, object 'A' never exists without a container object 'X'. So 'A' is never directly operated upon. 'A' aggregates in 'X'. We don't want to expose 'A' to the outside world. For this we have taken the approach, not to have the public ...

classes as enum (or somthing like a enum)

I'm working with a third party web service that exposes a status property on one of its classes but this property is in fact another class itself. Whilst this is no great shakes I'm trying to make use of this web service easier for other developers in the company since the web service is abstracted away and we have our own adapter class...

Designing mvc controller layer

Hi, I am trying to understand and practice the MVC-pattern to improve my development. So I started refactoring an application I once wrote and have progressed so far. It is completely clear how my model looks like and also the view is ready so far. But now I am searching for a good practice to design my controller layer. I have created a...

How to justify using a scripting language as part of a project

I have a specific project in which I want to use either a scripting language + C, or as an alternative a 100% Java solution. The program adapts a legacy system for use with other moderns systems. Basically, I have few choices as to what language I can use. I have C/C++, Java 1.4, and I have also compiled the Lua for this environment. ...

What's the best way to design a custom button that changes font color/size when selected?

I want to design a custom component that extends Button that will have two new styles: selectedColor and selectedFontSize. These will allow the button to have a different text label color and font size when the button is selected. (When I say 'selected' I mean selected state, not being selected (mouse down). The approach I've taken is...

Silverlight 3 - Changing Merged Dictionary Dynamically

Hello, how to go from: <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="teste.App"> <Application.Resources> <!-- Resources scoped at the Application level should be defined here. --> <ResourceDictionary> <ResourceDictionary.MergedDic...

Tracking a Change on a Column

I recently ran across a very interesting problem involving database design. I have changed the table names to simplify the problem, so let me describe it as such: I have 2 tables, fruit and vegetable each stores whether or not a fruit or vegetable is tasty. Now lets say that someone keeps changing the IsTasty setting through the UI of m...

At what level of abstraction does Single Responsibility Principle (SRP) no longer make sense?

I'm getting push back on a design from a colleague, and am wondering if there's consensus as to who is correct on application of SRP in this case. I see SRP as relating mostly to the lower-level details of design, such as class responsibility. As you move up in levels of abstraction I believe SRP is still relevant but that the definiti...

Silverlight: TemplateBinding a Rectangle

Hi, I'm having a heck of a time trying to template bind the StrokeThickness of a rectangle. My goal is to allow a user of my custom control to set a property called SelectedBorderThickness which will, in fact, set the StrokeThickness of a rectangle. I thought I understood templating but I guess I really don't. If I do this: <Rectangl...

How would you like an API to expose error handling?

This title begs for more explanation. Basically, I'm rolling an API that wraps a web service in a nice heirarchical model. This model exposes things in the form: var obj = MyRemoteResource.GetForId(1234, SourceEnum.ThatSource); ApiConsumerMethod(obj.SomeProperty); //SomeProperty is lazily loaded, and often exposes such lazily loaded ...

Janus Tabs - Right-to-Left instead of Left-to-Right

how do I make Janus tabs to be from right to left in RTL languages instead of left-to-right as they are in the usual way? (in c#) ...

Implement Register/Unregister-Pattern in C++

Hello everyone! I often come accross the problem that I have a class that has a pair of Register/Unregister-kind-of-methods. e.g.: class Log { public: void AddSink( ostream & Sink ); void RemoveSink( ostream & Sink ); }; This applies to several different cases, like the Observer pattern or related stuff. My concern is, how sa...

Usability and Accessibility for Desktop Applications

Hi, I am about to start developing a desktop application, and I am interested in making the application both usable and accessible for end users. Can anyone suggest online resources that offer guidance for developing usable desktop applications? In particular, I would be interested in learning about how to test desktop applications f...

Choosing colour schemes

How do you choose your colour schemes for your applications and/or web designs? Is it a gut instinct thing or can logic be applied here too? I have looked at some colour theory but my combinations seemed wrong. I am looking at a monochrome webpage. Rather than pluck colours out of the air as usual I would like to see if there is a sc...

Is it better to rewrite inherited code than fix it?

Possible Duplicate: When is it good (if ever) to scrap production code and start over? Say you have been given a project, and you look at the code. Although it works, and is functional, you realize that to make future changes it would be easier to rewrite a large portion or all of the code. Is it better to do the rewrite? If it ...