design

A couple questions about Sutter's concurrency series on Dr. Dobbs

I have a couple questions about Sutter's concurrency series on Dr. Dobbs. 1) Sutter recommends moving code not requiring locks out of critical sections to (apart from increase the granularity of the critical section) keep from nesting critical sections, in the event that the nested calls themselves enter critical sections. I have always...

MVC Architecture. Whats in a model?

I am new to MVC but I can already see its benefits and advantages. However, I have a (probably easy to answer) design question: I have been thinking about models and debating the proper way to structure them. The way I see it there are a few options: 1) Models and table structure have a 1 to 1 relationship...meaning that pretty much ...

Why aren't more applications written in multiple languages?

Even 2 decades ago, it was possible to call code written in one language to call code written in another; in school we called assembly graphics routines from within Ada code for one class assignment. Notable exceptions are running compiled code from within scripts or executing a system command from within compiled code; but rarely do we ...

In search of Module Web Design architecture

Hi All, I'm designing a large web application and I would like to finally be able to modularize the different elements on the page. I'm using the Zend Framework. I would like to create independent modules that I can combine to create a page(e.g. Contact box, Search Box, Latest blog comments...), sort of how Drupal would do it. These ...

Office 2007 look and feel for web site

Do you know where a can find a web site template for a web site that would look like Office 2007. I am looking for the right colors, hover, etc. ...

Is there a better way to get old data?

Say you've got a database like this: books ----- id name And you wanted to get the total number of books in the database, easiest possible sql: "select count(id) from books" But now you want to get the total number of books last month... Edit: but some of the books have been deleted from the table since last month Well obv...

How to design a Website Dashboard ?

Hello Are there any design examples of Website Dashboard showing Sales Statistics ? ...

Windows UI Design - The Combo Box

Until today I had not realized there was a difference between a list-box (like the HTML Form control drop-down selection box) and a "combo box" which is a combination of the list-box and the text-entry control. So the ComboBox allows the user to enter in a new value and if programed to do so, will append the value to the list of values ...

Storing search criteria in a database

I am working on an enhancement to a Flex dashboard that will allow the users to save searches. I'm using BlazeDS and Java/Spring/SpringJdbc on the server side. My question is this: how would you model a search that has one or more criteria, such as: Value Date between 2009-10-01 and 2009-10-31 Currency = 'USD' Bank Name starts with ...

Is it acceptable for an API to have documented bad behaviors?

Is it acceptable for an API to have bad behaviors (like segfault, bus error, memory leak) if the condition that would cause the bad behaviors is documented? Or should it always fail "gracefully" in all known conditions? ...

How have your ideas about C programming practices changed in the last ten years?

Object-Oriented programmers seem to have all the fun. Not only are they treated to major framework revisions every two years, and new and Improved languages every five, they also get to deal with design practices tailor-made to their programming style. From test-driven development to design patterns, Object-Oriented programmers have a ...

How can I force all derived classes to implement an abstract method or property?

An abstract function must be implemented by all concrete classes. Sometimes you want to force all derivative classes to implement the abstract function, even derivatives of concrete classes. class Base { protected abstract Base Clone(); } class Concrete : Base { protected override Base Clone(){...}; } class Custom : Concrete {} I wou...

How to verify external resources are available

How do you verify the state of the environment for a system without drastically increasing the scope of the system? I'm working on a system which talks to some remote servers. For example, it connects to a server and grabs logs of MyApp that ran on that server. These remote servers use a multitude of operating systems and are "manually"...

UI Advice: how to design a form with a lot of data

I'm re-writing an app that is a data-entry tool. The existing app is in Access and consists of a form with multiple grids, with each grid containing many columns that requires the user to scroll horizontally in order to view columns. The current grids on the form are layed-out heirarchically in parent-child relationships. Top grid repre...

ASP.NET Application Suite Development - Gotchas

This may sound a bit general, but I have a startup that is working on an ASP.NET (greenfield) suite of software applications. We are aiming to spend a substantial amount of time in the architecture phase to develop a strong foundation for our software. I was wondering if anyone has any advice, anything we should focus on or any suggestio...

When to separate columns into new table

I have company, customer, supplier etc tables which all have address information related columns. I am trying to figure out if I should create a new table 'addresses' and separate all address columns to that. Having address columns on all tables is easy to use and query but I am not sure if it is the right way of doing it from a good d...

Designing an autocomplete system to choose an instance of an aggregate type

An aggregate type T is made up of 4 strings: t = c1 c2 c3 c4 Each of c1 c2 c3 c4 can have a number of unique values: c1 may have a number of unique values c1.1, c1.2, c1.3, ... c1.n, where 'n' can be fairly high, about 30,000. c2 has far fewer unique values, no more than 5, i.e., n < 5 For c3 and c4, n is unpredictable but generally 1...

Do you use a flag or make it two operations?

An interesting discussion arose today around the concept of having one method with flags versus two methods for each state of the flag. Which makes more sense and why? void Submit(object data, bool isDraft); or void Submit(object data); void SubmitAsDraft(object data); I am tending toward the later, where each operation explicitly...

In Need of Refactoring in Order to Improve Testability

Hi, I'm testing a simple DAO layer with mockito but I found a problem, basically a hard to test interface and I was wondering if you could give me some insight... This is the method I want to test: public Person getById(UserId id) { final Person person = new PersonImpl(); gateway.executeQuery(GET_SQL + id.getUserId(), new Resu...

sprintf and char [] vs. string

I need to pass const char * to a function. Before I pass it, I usually need to build it from some variables. I can never decide which approach is more elegant, and overall better: Allocate an array long enough to fit the text and use sprintf to build the final variable and pass it to the function. Initialize string s with a variable us...