design

Object oriented CSS: should it matter?

Hello all, I've just found this interesting presentation about the concept of "object oriented CSS". It seems to be a good idea but the presentation is rather short and doesn't give a lot of examples. My questions: is this concept relevant? what are the benefits of OOCSS? can you provides me with complex exemples of "object oriented ...

How to organize API?

I am designing an API and I would like it to be simple to use. So, if I have Customers, Statements, and Payments. Does it make sense to have objects such as: Customer, CustomerHandler, Statement, StatementHandler, Payment, PaymentHandler? This way when the developer wants to do something with customers he/she knows to create a Custom...

Looking for a good approach to "spec" a project.

I have noticed that when writing specs you waste a lot of time on things, that later, when you write your app are negligible, and you forget some important stuff. I have found it to be faster (for me) to write a proof-of-concept application (no good error handlers and security stuff, minor gliches in the style etc) and use that as a spe...

How to access application level objects (ie. logger, container, unit of work) ?

What is the best practice on setting and keeping these "global" objects ? I have encountered this problem couple of times with ORM session object (XPO from DevExpress) IOC container (Microsoft.Unity) Logger (from The Object Guy) I have come up with three options on how to deal with this: Dependency injection. This looks extremel...

What is the name of this factory type pattern and how do I represent it in UML?

Example: I have several types, e.g. Wheel, Brake, Engine, Clutch, AutoBox, ManualBox, ElectricWindow, RearParkingSensor, HeatedSeats. These will all inherit a ICarPart marker interface (could be an attribute (java annotation), but doesn't matter at this stage). I then write my Car class that can represent all car types, e.g. class Ca...

Material on Software design and architecture

I am trying to compile a good library [within a company] on software design and architecture. I have looked at few posts on Stack Overflow, assuming this sort of question is very popular, however the best I found was Best books to learn about design, and it talks about graphic design, which is NOT particularly helpful to me. We are de...

Store pointers to member function in the map.

I'd like to map string to an instance member functions, and store each mapping in the map. What is the clean way of doing something like that? class MyClass { //........ virtual double GetX(); virtual double GetSomethingElse(); virtual double GetT(); virtual double GetRR(); //........ }; class Processor { private:...

XAML Expert Questions

I am a small ISV. 2 developers. I have an existing application for windows that we sale. I would like to rewrite the UI using WPF and maybe even create a Silverlight version on the web. I have 20 years experience, and I learn things fast. I am sure I could learn XAML, WPF, and Silverlight. However, I am wondering if I should write the i...

What new functionality is available through delegates and events in C# 3?

I feel that I am not utilizing all the features of delegates/events available in .NET 3.5 and beyond. And more or less still using delegates power available in 2.0. I would appreciate if you tell me how delegates/events should be used now, tricks, short-cuts. Thanks. EDIT Jon suggested his publication on this subject, and I am post...

Do you mix and match CSS 'and' ASP.NET .Skin files?

Is it CSS for HTML elements and SKINS for ASP controls? Or is it CSS all the way even thought it seems to take longer? And what has Specivity SKINS or CSS? I ask because I'm creating my first ASP.NET web application (using a book), while at the same time reading another about CSS. I'm now at the point where I need to start thinking abo...

Disabling resize controls in IE

I have a web application, HTML wysiwyg editor based on TinyMCE (javascript). The content editing is enabled in Internet Explorer with designMode="on". If I put an iframe in the edited content: This is the content I am editing as HTML source. <iframe src="..."></iframe> <b>I just added an iframe to my content</b> The iframe will beco...

What is the best way to declare a global variable?

In C++, say you want to declare a global variable to be used by many. How do you do it? I commonly use declare and define in cpp file, and then use extern in other cpp file (and not headers). I don't like this approach, and I am considering something along these lines: In a header file: some_file.h Class MYGlobalClass { }; MyGl...

What diagramming techniques (not tools) do you use during your programming?

What diagramming technique(s) do you use while programming to help you or others understand your program or design. I am not talking about a person's favorite tool, though a good tool probable helps a person greatly with diagramming. My intent in this question is to find the simple useful diagramming techniques people actually use and f...

What would be the correct design for keeping configuration settings in c++?

Say I have ini/json to store configuration setting of my desktop application,Will it be ok to have a static object with all property loaded at startup/when ever it is required or is there any other better alternative? Since this is the very first time I am doing this ,so just wanted to know whether static object is fine or singleton pat...

How do you usually return an instance of a user-defined type allocated on the local stack

I am curious about prevalent methodologies. I found myself doing both of these things interchangeably: Note in all cases the object is allocated locally. std::string GetDescription () { std::string desc; /* Create a description */ return desc; } void GetResult (map<int, double> & resultMap) { /*Fill map r...

How do you make one generic select method for your DAL ?

Scenario You have an Assembly for Data Transfer Objects containing 10 classes that exactly represent 10 tables in your database. You generate / build a DAL layer that has methods like - DTOForTable1[] GetDataFromTable1(); DTOForTable2[] GetDataFromTable2(); and so on.... Question How do I make a method that hides the numerous...

web application interface optimisation - fonts / tips ?

Hola stackoverflow, I'm building an interface with a lot of info on the screen.. dozens of inputs, with accompanying labels. as a result of the volume of info the fonts have necessarily become pretty small. but I'd like this to be as readable and usable as possible.. is there a really nice font that's both readable and compact, that wo...

WPF Can Text be Overlayed/Underlayed with a Thumb?

I've got a WPF UserControl that works as a floating "chat window" for an application I'm writing. Basically, three rows in a grid: header, richtextbox for the chat messages, and finally a textbox for user input. The header element has a Thumb on it so that the user can drag the chat window around inside the application. But I also need...

WCF: Separate service per Business Entity

Hi, If for example, you have customers, orders and products. Do you create a separate service for each of these business entities? It kinda feels logical that you should create a service contract for each of these. However, since you have to explicitly specify the contract that your service will implement… this sort of forces you to c...

What's the difference between data and code?

To take an example, consider a set of discounts available to a supermarket shopper. We could define these rules as data in some standard fashion (lists of qualifying items, applicable dates, coupon codes) and write generic code to handle these. Or, we could write each as a chunk of code, which checks for the appropriate things given th...