design

Best practices for legacy compatibility

From my experience, commitments to backwards/forwards compatibility are the gilded cage of the software engineering industry. I have particularly observed this to be the case for document file formats and programming languages/APIs. Customers and partners hate it when their existing data or code breaks; however, if you never break compat...

Why don't win32 API functions have overloads and instead use Ex as suffix?

The win32 API has for example two methods StrFormatByteSize and StrFormatByteSizeEx. Even though both the methods symantically do the same thing and the Ex counter part only offers a new parameter to slightly change the behavior then couldn't they have two overloads of the same function? Is it a limitation of c/c++ or what is the possib...

When can a design pattern make your software worse?

When can a design pattern make your software worse? I have seen a program where they used the facade pattern between the GUI and logic. They considered that no objects may be transported over this, so only primitive types were used which made it difficult to code. ...

Limit the # of rows being housed in a SQL table

This is a table design issue. I have a table that stores IP addresses. The data in the table is queried very heavily. The IPs can have different flags such as "unblocked", "temporarily blocked" and "permanently blocked". 95% - 99% of the IP addresses do not have any type of block on them. Is there a way to limit the # of rows in t...

Divide by Zero Display Values

What is the best way (most intuitive to users) or best practice for displaying the results of a divide by 0 error when doing reporting? Within the report, I capture this error, however, when displaying it on a human readable report; I am not sure how to note this. An example would be something like Weight / Revenue ratio. For a given...

How do I get this CSS text-decoration issue to work?

Some days I swear I'm going mad. This is one of those days. I thought my CSS was fairly straight-forward here, but it just doesn't seem to be working. What am I missing? My CSS looks like this: ul > li { text-decoration: none; } ul > li.u { text-decoration: underline; } ul > li > ul > li { text-decoration: none; } ul > li > ul > li....

A good algorithm for generating an order number

As much as I like using GUIDs as the unique identifiers in my system, it is not very user-friendly for fields like an order number where a customer may have to repeat that to a customer service representative. What's a good algorithm to use to generate order number so that it is: Unique Not sequential Numeric values only < 10 digits C...

Is it OK for an abstract base class have non-abstract methods?

An abstract base class (interface class) usually has all its member functions abstract. However, I have several cases where member functions consisting of calls to the abstract methods of the interface are used. I can implement them in a derived-but-still-abstract class, or I can implemented the methods as non-abstract, non-virtual meth...

How to handle with older IE versions and webdesign?

Hi guys, maybe it's completly my foult to handle so blind, but yes, now I am in a bad situation. Since month I build an auctioneering platform, the deadline is getting shorter and now - at the end of the project - we do a browser test with older browsers (e.g. and the worst: ie6). What should I say? The complete design fails in IE6. T...

design pattern asking for advice: push model v.s. pull model

Hello everyone, My application has several workers (working on different things as different processes) and some resources (working unit). Different workers need to process on all working unites. For example, I have workers like W1, W2 and W3, working unit U1 and U2. Then W1 needs to process U1 and U2, the same as W2 and W3. The restric...

Design level problem: multiple enums or looping the enum in UI code in order to make visibility decision ?

Hi!, we have a debate about a BEST PRACTISE from a .NET architecture DESIGN POINT OF VIEW: Task: How to manage role based visibility in UI with enum? For example: I want to show all team types [a,b,c,d,e] to administrator but only team types [a,b,c] to normal user. First I have enum which includes all team types: public enum TeamTyp...

To change a language automatically, should you use the Keyboard Language or the Location value?

To change a language automatically, should you use the Keyboard Language or the Location value? ...

What's the best approach for creating visually appealing windows applications?

I am currently working on my final year project. I'm trying to implement a system which takes sound as a input from microphone and, according to that sound, the UI displays different images. For example, if I input the sound of a dog, an image of a dog should display. Similarly, if I input the sound of a cat, an image of a cat should a...

Validity Check, which button image should i use?

Hello, in my software there is a validity check, which checks each input in my form. The user can click on a button to do this check. My question is, if there is a recommendation which button-image should be used for a validity check, to get a homogenous gui in a windows-environment. Or are there some gui-design-guidelines which describ...

Is having a function call block a bad design process?

I'm writing an API which is used to receive some data from another application. Currently the function is designed to block until data is received. In my mind this limits developers using the API to use multithreading or some sort of multi-process design. So is it better for a function to block or to return a null and then sleep for a fe...

.NET document management system design - performance questions

I need to develop a basic .NET document management system with the following specifications: The data should be portable and self contained, so I will serialize the documents (typical formats include Word, PDF, Excel and Powerpoint) into binary data. I will then store said binary data in a SQL Server 2005 database. When a user needs to...

Intel has just unveiled a new 48 core CPU. What will this move to many cores imply for us programmers?

Intel has just unveiled a new 48 core CPUs. More than just the number of cores, this new architecture seems to introduce a lot of interesting features, such as this one: Things get interesting here - Intel is saying that they have removed hardware cache coherency which effectively means each "tile" will be completely separate in what...

One parent object for multiple child objects.

Is it possible to have one parent object for more than one child object so that all the child could share the same parent state? ...

recurring payment on a specific date

Hi All, I need to create a recurring payment that should process only twice. First, I need to get an advance amount and remaining amount should be payed in another date. Now, I would like to have the time reduces according to the initial payment date. For instance, assume user purchases today then recurring will be set for 60 days, i...

How to prevent unboxing - boxing memory overhead when reading arbitrary sql rows

Guys, I'm writing a class to represent a row from a SQL query. I want the field data to be accessed via the indexer property of the class. This is straightforward enough if I load the data into an internal List of Object. I've already tried this and am not happy with the boxing for the primitives. Boxing increases the memory requirement...