design

Which is the best UI from the movies

I see movies as a rich vein of design ideas to make our interaction with computers better. I'm sure there are many brilliant examples out there, I've put in some of my favourites, I'd like you to let your imagination and memory run free and feed the wiki. Clearly HAL had a pretty good UI, but it lacks much that we can build on today. ...

Correct implementation of Memento

With the memento design pattern, is it wrong to have the Caretaker as an aggregate of the Originator? ...

ASP.NET MVC: Use existing Account or create new User controller?

I'm creating a new ASP.NET MVC application. So far I've used the Account controller for actions related to a user's account -- Login/Logout, Activation (like Register, but I use Register for other actions in the site so I've renamed it), Add/Update Contact information. Up to now, though, I've been concentrating on the administrative use...

Python Virtual Machines architecture diagrams/references

Someone could point out sites/books where I can find introductory documentation about the architecture of the Python VM? I'm interested in the C version, but if there are easy-to-follow references about other implementations it could be helpful too. I'm trying to find any kind of resources of higher level than plain source code (howev...

What is the best way to achieve a multi-column layout in CSS and HTML?

I have a problem in HTML. I have divided the HTML page into two columns: My code: <div id="outer"> <div id="inner1"> <div id="data1"> </div> <div id="response"> </div> </div> <div id="inner2"> <div id="data2"> </div> </div> </div> My CSS: #outer { background-color:#FFFF99; } #in...

How do I secure data access in my new API?

I am designing an API, and I'd like to ask a few questions about how best to secure access to the data. Suppose the API is allowing access to artists. Artists have albums, that have songs. The users of the API have access to a subset of all the artists. If a user calls the API asking for some artist, it is easy to check if the user is ...

Design a networking application

Problem: I need to design a networking application that can handle network failures and switch to another network in case of failure. Suppose I am using three ethernet connections and one wireless also . At a particular moment only one connection is being used. How should I design my system so that it can switch to another network in ...

Hierarchy / Flyweight / Instancing Problem in Python

Here is the problem I am trying to solve, (I have simplified the actual problem, but this should give you all the relevant information). I have a hierarchy like so: 1.A 1.B 1.C 2.A 3.D 4.B 5.F (This is hard to illustrate - each number is the parent, each letter is the child). Creating an instance of the 'letter' objects is expensive...

Will the real strategy design pattern please stand up?

I had a geek fight with someone over what the strategy pattern really is and I need a little expert help (read: definitive proof). We both agree that the strategy pattern allows for the guts of a class (e.g., the behavior) to be swapped out at runtime while maintaining the same interface. However, her contention is that "For [the algori...

CSS irregular frame around variable-size content?

Apologies for this sketch, but seems to convey my question best: +---------------+----------------+-----+ | div | v.div | d | | | | i | +----+----------+----------------+ v | | v | | | | . | ...

C# CA2104 - Automated Code Analysis dislikes static readonly mutable types

I've got a code like this: public abstract class Base { // is going to be used in deriving classes // let's assume foo is threadsafe protected static readonly Foo StaticFoo = new Foo(); } Visual Studio 2008's Code Analysis pops up this message: CA2104 : Microsoft.Security : Remove the read-only designation from 'Base.S...

Does being arbitrarily flexible make code messy?

Does the rigidity of clear interfaces mean that flexible code must be ugly? I'll use Java and Perl as respective examples. Clarification: it's not that code being messy makes it flexible; but that code being flexible makes it messy. Clarification: "flexibility" almost has a different meaning in exploratory code vs older code. P...

Complicated Algorithm - How to store rules separate from processing code?

I'm working on a project which will do some complicated analyzing on some user-supplied input. There will be 3 parts of the code: 1) Input supplied by user, such as keywords 2) Rules, such as if keyword 1 is repeated 3 times in keyword 5, do this, etc. 3) And the analyzing itself which executes the rules and processes the user input, ...

What's the most elegant way to use stored procedures?

I'm re-writing the inline SQL in my repository class to use stored procedures instead (security requirement). After using Fluent NHibernate and Linq2Sql in the past I'm finding it to be extremely unwieldy and inelegant. EDIT: To clarify, I'm not looking for an ORM solution that works with stored procs. I just want some advice on a nice ...

To encapsulate database connection in business objects or not?

I usually like to create the database connection myself and control its lifetime manually with `using{}'. For example: SqlConnection sqlConnection = new SqlConnection( connectionString ); using( sqlConnection ) { BusinessObject myBusinessObject = new BusinessObject( sqlConnection ); // do stuff with the business object ... }...

Flash-like visual effects in JS / jQuery

I know there are thousand of visual effects made in JS that can be found on Google. But most of that effects are useless in web-design, or are outdated like "clock following mouse cursor" :| Also I know sites like http://www.chromeexperiments.com and http://www.dhteumeuleu.com but those examples make web-browser uses 100% CPU power and m...

What's the best way to implement observer pattern for many types?

I have an agent that monitors for certain conditions. For each condition, I would like to notify a different observer, because the responsibility for that condition lies with the observer. The way to do it for a single observer/subject in C++, according to wikipedia, is to create a virtual class (similar to a Java interface), which def...

What is the difference b/w Design and Architecture ?

What is the difference b/w Design and Architecture ? hi , i have asked this question from many teachers but no one gave me satisfactory answer . these two terms are very diffused .. i am not getting them correctly .. waiting for an accurate answer... any real time example or scenario that can elaborate this difference ?? ...

what is the difference b/w Layer and Tier ?

Duplicate: What’s the difference between “Layers” and “Tiers”? HI , i am having confusion about these two terms what does these two terms mean ? what is the difference b/w Layer and Tier ? ...

How can I resolve the conflict between loose coupling/dependency injection and a rich domain model?

Edit: This is not a conflict on the theoretical level but a conflict on an implementation level. Another Edit: The problem is not having domain models as data-only/DTOs versus richer, more complex object map where Order has OrderItems and some calculateTotal logic. The specific problem is when, for example, that Order needs to grab the...