design

What Is The Best Place To Store An Object's XML/CSV/Other Representation

When an object has various formats (XML,CSV) it can be represented in, where should one store knowledge of those formats. Should the object have knowledge of how it's represented in XML (i.e. letting the object convert itself through some method on the object such as GetXML()). Is this too much knowledge for the object and should this b...

C# (.NET) Design Flaws

What do you think are the biggest design flaws in C# or the .NET Framework in general? My favorites are that there's no non-nullable string type and that you have to check for DBNull when fetching values from an IDataReader. ...

Google Gears - To what level is synchronization supported?

Hi All, I have a few questions about data synchronization. The architecture does not seem to be clear about this: Does Google Gears provide from automatic synchronization of data (from client to server and server to client)? If it does provide for automatic data synchronization, then can i write functions to hook into the sync mechani...

Struct with boolean field default initialization?

I have the following use case, a struct with some boolean and int variables struct a { int field1; bool field2; bool field3; }; I am refactoring this code, and writing a constructor for the struct , the problem is the default initialization of fields. I am not criticizing any language construct here, but ideally I woul...

Which contract (Design by contract) is better?

Suppose I have a method public Patient(int id) { ---- } that returns Patient object given an id.. I could define contract in 2 ways Method would return null if patient does not exist Method would throw an exception if patient does not exist. In this case I would also define a query method that returns true if the Patient exist i...

Using CSS to create table cells of a specific width with no word wrapping.

In a project have been involved in I needed to render tables with columns of a specific width with only one HTML line per table row (no wrapping). I need each table cell to have a padding of 1 pixel at the top and bottom and 2 pixels at the left and right. The best way I can come up with that works cross browser is to put a div inside a ...

Web user expectations

When designing a good Web GUI what expectations can we expect from an end user? I've come up with the following, but I wonder if there are any others which can suggest.. If I click on a hyperlink it will take me to another page/part of this page If I tick/untick a checkbox it might alter the page state (enable/disable elements) If I ...

Double reversals on technology decisions

Have you ever gone through a painful switch from one technology to another, only to switch back later in a project's lifetime? Was it because the technologies evolved differently than you expected, or because of something you didn't understand about them in the first place, or because they didn't fly when it came to beta testing or prod...

What is the best way to build a data layer across multiple databases?

First a bit about the environment: We use a program called Clearview to manage service relationships with our customers, including call center and field service work. In order to better support clients and our field technicians we also developed a web site to provide access to the service records in Clearview and reporting. Over time ...

quick-and-dirty vs. good design

What do you do when your manager wants you to implement something in a quick and dirty way and you just know it's going to backfire? My manager wants me to develop a web app for a client and to do it as quickly as possible. This is the first web app we're building for this client, and I think it's important that we do it right so that ...

Is "tip-of-the-day" good?

Many programs (often large ones, like MS Office, The GIMP, Maxthon) have a feature called "tip-of-the-day". It explains a small part of the program, like this one in Maxthon: "You can hide/show the main menu bar by pressing Ctrl+F11" You can usually browse through them by clicking next. And other options provided are "Previous", "Close...

Design Question - Storing Images as Objects.

Ok, so my site is centric to a lot of dynamic user entered images for different user defined objects throughout. So I have many objects, and those objects have images. Is it good practice to treat images like an object since the "Image Name" and "Image Bytes" columns are repeated many times? Or is it more sensible just to include those...

Interfaces in Class Files

Should my interface and concrete implementation of that interface be broken out into two separate files? ...

Would you use EnterpriseServices in a new enterprise development?

As you may already know, managed code (.NET apps) can make use of COM+ through EnterpriseServices, making issues like distributed transactions, resource pooling and synchronization "simpler to program" because the solutions are provided as a supporting infrastructure to the application by COM+. If your application servers reside in a W...

How do you come up with a good name for a software company?

I'm starting up a web design shop and hoping to also get into custom software development. So the problem I'm having now is coming up with a name for the company. I want something cool and funky, but I'm not sure where to go for ideas. Someone suggested that I name it after a fruit (well "Apple" is already taken :)), or a famous ship,...

Is this design a good idea - Interfaces and Abstract class

I would like to be able to do somthing like the following: //non-generic var MyTable = new Table(); string name = MyTable.Name; IEnumerable<String> rows = MyTable.Rows; //generic var MyTableGeneric = new Table<MyType>(); string name = MyTableGeneric.Name; IEnumerable<MyType> rows = MyTableGeneric .Rows; Would something like this be t...

Abstracted References Between Entities

An upcoming project of mine is considering a design that involves (what I'm calling) "abstract entity references". It's quite a departure from a more common data model design, but it may be necessary to achieve the flexibility we want. I'm wondering if other architects have experience with systems like this and where the caveats are. Th...

Can I reuse a Transaction? and how?

I must use a corporate class that re-uses or re-creates a transaction after every Commit() or Rollback(). This class is told to use (or not use) transactions via a Boolean ctor parameter. I am thinking of wrapping this API to separate the transaction support (to rely explicitly on Transaction objects or the ambient TransactionScope). Bu...

Design of a polling event API

Say you were designing a C++ windowing library. It may or may not provide a callback API, but needs to provide a polling API to facilitate a functional style of programming. What would the polling API look like? Some options SDL style struct Event { enum { MousePress, KeyPress } type; union { struct { Point pos; Mouse...

Using PowerMock or How much do you let your tests affect your design?

I've been a fan of EasyMock for many years now, and thanks to SO I came across references to PowerMock and it's ability to mock Constructors and static methods, both of which cause problems when retrofitting tests to a legacy codebase. Obviously one of the huge benefits of unit testing (and TDD) is the way it leads to (forces?) a much...