design

c#: How can I verify methods are called in a certain order?

I have the following class: public class Script { IPrinter _printer; public Script(IPrinter printer) { _printer = printer; } public void Print(TextWriter writer) { _printer.PrintComment(writer, "lolz"); writer.WriteLine("omg this complicates things"; _printer.PrintSpecial(writer)...

What's the rationale behind headers?

I don't quite understand the point of having a header; it seems to violate the DRY principle! All the information in a header is (can be) contained in the implementation. ...

Is an 'SQL dictionary' the best way to deal with this?

Quite often at work we'll have a scenario where we have an item in the database that we need to assign multiple staff members to. Normally we do this assigning by creating a new table with two columns, the first being the items ID and the second the Staff member's ID so when we want to either look at all the items assigned to a staffmemb...

Architecture Questions : Centralized Server v/s Localized Server Approach

Hi, My question is related to Architecture of the Application on which am working right now. Currently, we are installing server locally on each box and that server get's data from the client and does some kind of processing on it and than it generates output and receipt is printed depending upon the output data, and that output data i...

Make a label appear for 3 seconds, and then dissapear again.

How can I have a label saying: "Registry updates correctly" and then have it dissapear after about 2 seconds? I'm guessing by modifying the .Visible property, but I can't figure it out. ...

Table vs CSS-based layouts for web pages

Hi, I use HTML templates for my website from sites that sell templates as I'm not a designer and would like something ready, I use Rails for my development. I noticed that some sites design their templates as "Tableless" by using CSS and absolute posistioning of components in the page. I'm actually used to using tables in my pages. Wha...

A design problem

What I have? I have below requirements: Search the database and return TreeNode objects to build a tree view Search the database and return a generic list to construct a diagram. Extensibility should be there to do search and return different type of objects Database is huge and performance should be considered with high priority Wh...

Learning to write reusable libraries

We need to write simple scripts to manipulate the configuration of our load balancers (ie, drain nodes from pools, enabled or disable traffic rules). The load balancers have a SOAP API (defined through a bunch of WSDL files) which is very comprehensive but using it is quite low-level with a lot of manual error checking and list manipulat...

Should I still code to the interface even if I am ONLY EVER going to have ONE implementation?

I think the title speaks for itself guys - why should I write an interface and then implement a concrete class if there is only ever going to be 1 concrete implementation of that interface? ...

Which Presentation Pattern would you choose to design a jsf-based app ?

Pros and cons of : Supervising Controller / Passive View / Presentation Model ... ...

So was that Data Structures & Algorithms course really useful after all?

I remember when I was in DSA I was like wtf O(n) and wondering where would I use it other than in grad school or if you're not a PhD like Bloch. Somehow uses for it does pop up in business analysis, so I was wondering when have you guys had to call up your Big O skills to see how to write an algorithm, which data structure did you use to...

Having several data access logical components vs having just one

Hi, Say DB has three tables: Customer, Order and Products. DAL layer could use just one class ( aka one data access logical component ) to perform CRUD operations on all three tables, or it could use three different classes (aka three different logical components): 1) Customer Data Access Logic Component 2) Order Data Access Logic C...

Creating "pretty" Qt Custom Widgets

What is the process behind making custom widgets (using Qt) that don't look...well...ugly? I know it is fairly trivial to make a "custom widget" that has say, a listbox and a pushbutton slapped together into one, but how would I go about making something that looks more like this: QAnalogWidgets I have made some rough mock-ups that ba...

Should I use messaging instead of a database

I am designing a system that will allow users to take data from one system and send to other systems. One of the destination systems has a sophisticated SOA (web services) and the other is a mainframe that accepts flat files for input. I have created a database that has a PublishEvent table and PublishEventType table. There are also n...

Dynamic-link library for optical scanner

I am trying to refactor my project so that instead of many functions i would have some objects instead. I am writing an application, which is communicating with a specific optical scanner via Serial port. I use usual SerialPort's class methods (Write, Open, Close) and some advanced methods, which aren't included in standard class, like...

C++ DAL Design - Include Foreign Key Table as Composite Object

Hi, I recently posted this C++ DAL question about how best to design a 'loadCar' method in a C++ DLL, with the consensus being that 'bool DAL::loadCar(int id, Car&) {}' would be the best signature to use. Now, it so happens that in a lot of our use cases the client code will often want to retrieve the car's manufacturer with the car ob...

From screen design to final product: How is your workflow?

We are currently starting a bigger project. What're your suggestions for best practices of workflow? We are planning to rebuild from scratch (the existing product is outdated by years, regarding visual and internal design and programming). While the product functions (a Rails based web project) are already set, the question is: What is ...

How to deal with changing feature and product names in source code?

What is a good strategy for dealing with changing product and feature names in source code. Here's the situation I find myself in over and over again (most of you can relate?)... Product name starts off as "DaBomb" Major features are "Exploder", "Lantern" and "Flag". Time passes, and the Feature names are changed to "Boom", "Lighthous...

Does an n-tier system make "sense" for large data set processing?

I recently became a part of the team of developers writing our "flagship" product. Its primarily a read intensive web app (asp.net(c#) and oracle) implemented in an N-tier system. Most of the writes in the DB are done through external services (not through the webapp). Instead of scheduling normal batch jobs in the DB for data aggrega...

A few questions concerning this article about design principles

At here: http://www.jwz.org/doc/worse-is-better.html So according to the worse-is-better philosophy, implementation simplicity is the most important, above all? Does implementation refer to inner logic or? What does "especially worthless is consistency of interface" mean? I thought consistency in interface is pretty important. Thank ...