design

WS* vs REST = horses for courses ... or not?

Ok so I've implemented both REST and SOAP services and I like both depending on the context. For me, WS* is great when I want an explicit contract between the server and the client e.g. for sensitive information or for mission critical stuff. REST on the other hand whilst flexible in terms of the schema definition, is in my mind more ide...

C++ Parent class calling a child virtual function

I want a pure virtual parent class to call a child implementation of a function like so: class parent { public: void Read() { //read stuff } virtual void Process() = 0; parent() { Read(); Process(); } } class child : public parent { public: virtual void Process() { //process stuff } child...

Adaptive Base Design Patterns

I have been thinking about design patterns that are 'adaptive.' I am familiar with GoF designed to deal with known problems. What I am thinking about are the new, evolving technologies that the code I write will need to adapt to so that it can interact with evolving apis, programming languages, etc. I am adding an example to get at ...

What does it take to be a better OO programmer?

I’ve almost 6 years of experience in application development using .net technologies. Over the years I have improved as a better OO programmer but when I see code written by other guys (especially the likes of Jeffrey Richter, Peter Golde, Ayende Rahien, Jeremy Miller etc), I feel there is a generation gap between mine and their designs....

Managing Cisco programatically; Telnet vs SNMP?

I was recently approached by a network-engineer, co-worker who would like to offload his minor network admin duties to a junior-level helpdesk tech. The specific location in need of management acts as an ISP for tenants on its single-site property, so there's a lot of small adjustments being made on a daily basis. I am thinking it wou...

Most Astonishing Violation of the Principle of Least Astonishment

The Principle of Least Astonishment suggests that a system should operate as a user would expect it to, as much as possible. In other words, it should never "astonish" the user with unexpected behavior. In your experience as the "astonishee," what types of systems are the worst offenders, and if you were the project manager, how would ...

How to provide a Session/Host object for use in both a windows and web application?

I have a web application that makes heavy use of the Session state to store information about the current user, their personal settings, record their session history and so on. I have found myself retrieving this session information in my business layer, like so: ((UserSession)HttpContext.Current.Session["UserSession"]).User.Info Th...

What are some best practices for large-scale development in Python?

I don't like the "Is too! Is not!" nature of a lot of the responses that this question provoked. But I'm really interested in some of the answers, and I'd like to hear more about them. So I'm asking the question from a different perspective. It's pretty clear to me, after having built a number of medium-size Python projects by myself...

How pick colors for a pie-chart?

I have some code that generates image of a pie chart. It's a general purpose class, so any number of slices can be given as input. Now I have problem picking good colors for the slices. Is there some algorithm that is good at that? Or maybe I should just hand-pick and list fixed colors? But how many. Maybe 10 colors and hope there will ...

What is the optimal algorithm design for a water-saving urinal?

At work, we have one of those nasty communal urinals. There is no flush handle. Rather, it has a motion sensor that sometimes triggers when you stand in front of it and sometimes doesn't. When it triggers, a tank fills, which when full is used to flush the urinal. In my many trips before this nastraption, I have pondered both what the a...

prototypes versus classes

Steve Yegge recently posted an interesting blog post on what he calls the universal design pattern. In there he details using prototypes as a modelling tool, instead of classes. I like the way this introduces less coupling compared to inheritance. But that is something one can get with classes as well, by implementing classes in terms of...

C++ RTTI Viable Examples

I am familiar with C++ RTTI, and find the concept interesting. Still there exist a lot of more ways to abuse it than to use it correctly (the RTTI-switch dread comes to mind). As a developer, I found (and used) only two viable uses for it (more exactly, one and a half). Could you share some of the ways RTTI is a viable solution to a pr...

What modeling tools are everyone using?

I am trying to get a sense of what tools people are using for system modeling? Right now I use: Data Modeling - Erwin System Architecture - Visio UML - Visio I have been looking for a good freeware data modeling tool that can rival Erwin, but haven't found anything yet. I have always wondered if tools like Popkins System Architect ...

Web Application Infrastructure

I have custom coded several enterprise applications for mid to large organizations to use internally (some with a minimal external footprint). I now have plans for a web project that may (hopefully) see a large userbase with more daily traffic than my previous projects have ever attained. Obviously I want my design to be scalable and m...

How can one type access a private setter of another type's property?

All I need is a way to make a property of one class only 'settable' from one other class (a sort of manager class). Is this even possible in c#? My colleague 'reliably' informs me that I have a design flaw, but I feel I should at least ask the community before I concede defeat! ...

How to create a background-image on titlepage with LaTeX?

I want to put a background-image on a titlepage of a document. Is it possible and dows it work? EDIT: The answer from Presidenten using the eso-pic-package and my answer found after some research using the wallpaper-package are both working. ...

Best Mind Map Software

I like to use mind mapping software when I first start a project to gather specifications. What are the best free and commercial mind mapping applications? ...

Same fields in most tables

In a database prototype, I have a set of fields (like name, description, status) that are required in multiple, functionally different tables. These fields always have the same end user functionality for labeling, display, search, filtering etc. They are not part of a foreign key constraint. How should this be modeled? I can think of t...

Recommendation for text-based software design review collaboration tool

Much of the software design we do in our company is in Microsoft Word, embedding pictures and Visio diagrams where necessary. Can anyone recommend a good software design review collaboration tool that allows multiple parties to give review feedback in parallel? Currently, we use various methods none of which are ideal: Using "Insert ...

Downsides to using Int64 universally instead of int (C#)

We use a base entity with properties such as version (datetime needed for NHibernate) and guid (as key). It also has an Id (int) field with two functions. Firstly to relate to legacy application key if there is one. Secondly as a shorthand code: for instance files are sometimes created based on these which would look ugly and long usi...