design

C# - Design-related dispose question (take two)

I asked a question earlier today, but I think I need to approach it in a different way (on top of that there was a "hang up" in regards to DataSet). Here's a class that encapsulates the creation of a Font (in other words, it is reading data from an xml file and is creating a font, at runtime, based on what it reads from that file): pub...

How to create a constructor that is only usable by a specific class. (C++ Friend equivalent in c#)

As far as I know, in C#, there is no support for the "friend" key word as in C++. Is there an alternative way to design a class that could achieve this same end result without resorting to the un-available "friend" key-word? For those who don't already know, the Friend key word allows the programmer to specify that a member of class "X"...

Web API Design: Form POST'ing key-value pairs: JSON or checkbox style?

Design question for RESTful APIs: one of the input parameters to my API (that is, the data sent from the client to my API) is a dictionary (hash / key-value pairs). What's the best way to encode this so that the API can be easily invoked from web pages as well as scripts/programming languages? My first thought was to json encode the obj...

Is there something like Wordpress Themes for WPF, like off the shelf basic designs?

Hi! I'm no designer and can't get a custom design done. I would love it if there were basic but attractive free or cheap WPF designs available much like the wide-spread Wordpress Themes. Any URLs out there? Thanks! Gregg PS A nice WPF Design by Felix Corke on Scott Hanselman's blog ...

When to use callbacks instead of events in c#?

Forgive me if this a stupid question, I admit I haven't thought about it much. But when would you favour using a callback (i.e, passing in a Func or Action), as opposed to exposing and using an event? UPDATE What motivated this question was the following problem: I have a ThingsHandler class, which can be associated with a Thing...

recomendation for an open source software design tool

hi, i am sorry but i had enough from MS Vi$$o as a software design application, i have been using it for ages and i find the user experience comparable to a Chinese torture (with out insulting the Chinese nation). we are just drowning Squares there is no reason for it to look so gray and complicated ... ;-) can anyone recommend me a ...

Implementing Centralized Hotkey Handling/Processing

I'm working on a project where I need to implement customizable hotkeys across the application. There are a number of different forms and user controls that need to implement different subsets of hotkeys. I would like to implement all of the handling and processing in a central MessageFilter class. I want to have a base class that h...

WCF Object Design - OOP vs SOA

What is the proper way to handle polymorphic business objects in a WCF/SOAP world? It seems to me that SOA and OOP are at odds with each other - to expose a clean WSDL you need concrete objects, typically not even utilizing inheritance. On the other hand, presumably in the underlying system, you'll want to follow proper OO design. Wha...

Design advice - When to use "virtual" and "sealed" effectively

Hi all, I'm writing a C# networking library (mostly as a learning exercise, it's not overly important to me if anyone actually ends up using it as I'm sure solutions are already out there). I'm fairly happy with my structure so far... I have a few layers of client/server available, that can communicate in raw bytes over sockets, or sli...

Separate policy from mechanism: What does it mean?

I've often heard the mantra of "separating policy from mechanism", especially in the context of the Unix philosopy. What does this mean and what are some concrete examples of it? When/why is/isn't it a good thing? ...

Why do most spreadsheets contain a hard-coded limit on the number of rows and columns?

Why are programs like Microsoft Excel, Gnumeric and OpenOffice.org Calc designed with hard-coded limits on the number of rows and columns? This seems like an archaic programming technique from when spreadsheets were considered a demanding application and dynamic memory allocation was considered "high-end". I would guess that it indicat...

Why do we use Interface? Is it only for Standardization?

Why do we use Interface? Is it only for Standardization? ...

Could we call web behaviour programming to javascript code?

Hi, I recently develop a web application that uses a lot of javascript code and I face how to design and code it. So, I realized that javascript is focused on how some html items behave on the web page and not simple functions or methods that makes easy changes to UI. Talking about web design, javascript could be considered as a web be...

Can I improve my module-skin architecture somehow?

Hi, I'm designing a CMS for a private project that should make the editing of the website simple. It supports modularism. However, it's still in beta, and I'm now asking if you can see something I could improve or if you have some entirely different approaches to this scenario. First of all, I have "themes" that are a set of HTML, CSS ...

Design Perspective: Static Methods vs. Classes

Although this is a fairly common problem, I am struggling with what the best way to approach it (if it needs approached at all in this case). I have inherited a website (ASP.NET, C#) part of which contains a class full of static methods (it's a very large class, honestly). One method in particular is for sending e-mails. It has every ...

Copy the current "view" of a Photoshop Document w/o having to Flatten?

Is there a way in Adobe Photoshop (I'm using CS4) to copy the current view of a document, including many different layers, to another application, such as InDesign, without having to flatten the image? ...

Does this inheritance design belong in the database?

=== CLARIFICATION ==== The 'answers' older than March are not answers to the question in this post! Hello In my domain I need to track allocations of time spent on Activities by resources. There are two general types of Activities of interest - ones base on a Project and ones based on an Account. The notion of Project and Account hav...

How do i get these things horizontal instead of vertical?

http://we-live.in/city.html -- id like to see RESOURCES and EVENTS side by side bc im listing 3 more... rather than on top of one another -- can i do that within the div or do i have to redesign the layout? <div id="row1"> <div class="wrapper"> <h2><script type="text/javascript"> <!-- document.write('<form name="selecter1"><...

designing keyword/tag input

I am currently working on a form and am stuck on a keyword/tag input field (think youtube.. or even stackoverflow). Anyway, I thought it was pretty logical to use ',' to separate the tags... which would allow users to use combinations of words as tags using ' '. However my boss wants it separated with just ' '. Which worries me as I thin...

What are the tradeoffs of reusing a cursor vs. creating a new cursor?

In cx_Oracle (or Oracle in general), is it possible to allocate a cursor for each query, or to reuse a cursor across several queries. def getSomeData(curs): # case 1: pass in a cursor, which is generally curs.execute('select ...') # reused across queries return curs.fetchall() def getSomeData(conn): # ca...