design

How can I keep content from re-sizing it's wrapper div?

I'm a css noob, and though I want this DIV to resize when the window is resized, I don't want inner content to change the size of it. ...

Is there an equivalent to out-of-process COM EXE in .NET?

One of the nice things about COM/ActiveX was the out-of-process EXE. You could have an EXE which exposed methods and properties in a form usable by both other processes, including VBScript and JScript. At the same time the EXE could have its own functionality, related or unrelated to that exposed by its type library. What is the .NET eq...

GUI Framework Plugin Design

As a plugin framework developer, I want to specify an interface, myNameSpace.IPlugin, that the plugins must implement. The return value of one of the interface members, IPlugin.GetWidget(), must be of a type derived from System.Windows.Forms.Control and it also must implement myNameSpace.IFoo interface. I also want to allow the plugin d...

word wrap/break in FF help?

I am building new site FF and IE compliant...what is best way to have sentences wrap to fill container in firefox? This works in IE without any problem. Currently I am using the following doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; thanks ...

Are "Dependency Inversion" and "Design to Interfaces" the same principles?

Do the "Dependency Inversion Principle" (DIP) and "Design to Interfaces Principle" express the same principle? If not, what would be the difference? EDIT To clarify and narrow down the context a bit: by interface I mean a programmatic interface, like a Java interface or a pure abstract base class in C++. No other 'contracts' are involv...

Learning to build real-world .NET apps by example

I've been doing mainly SQL and front-end HTML/CSS stuff for the past 4 years. I've done a quite a bit of (procedural) coding in a BASIC-like language, too. I do not have formal CS training (I have an econ degree). Now I'm switching gears to OOP in C# .NET full-time. In order to ramp up, I've been reading about fundamental CS topics (...

Does .NET have anything like PropertySet/EntityEngine design?

Hi, Does .net have any propertyset design/architecture? something like: http://www.opensymphony.com/propertyset/usage.jsp Or specifically: http://ofbiz.apache.org/docs/entity.html Is this how the entity framework is or is that different? Does it have an expernal .xml file that has mapping info? ...

Where do we draw the line with vocabulary when naming?

The other day I was looking through our code and I came across a class name IdempotentObject I didn't know what this meant at the time so I questioned whether it was a poorly chosen name. I found out who wrote it and asked the developer why he had named it so confusingly. He was surprised that I didn't know what it meant and told me tha...

UI hints that prevent user errors

What UI/GUI guidelines should be followed that subtly (or not so subtly) direct users so they don't shoot themselves in the foot. For instance, you might want to give power users the ability to "clean" a database of infrequently used records, but you don't want a new user to try out that option if they've just spent hours entering new r...

Smallest button size on a touchscreen

Hi all, I'm involved in writing a touchscreen application for a medical device. The program is kiosk-like, in that the start menu, etc, will not be accessible to the user, and the user will use an onscreen keyboard to type any text in the rare event that they need to. The spec'd screen size is 1280x1024. The question is this: What's...

Planning for parallelism

If you plan to write a very computationally intensive parallel application, what guidelines would you use to design your objects (whether classes or structs, or anything else) to maximize your potential of getting the most out of the parallelism. I am thinking of an application that say interprets/compiles a tree-like graph of objects t...

Java exception handling idioms ... who's right and how to handle it?

I currently have a technical point of difference with an acquaintance. In a nutshell, it's the difference between these two basic styles of Java exception handling: Option 1 (mine): try { ... } catch (OneKindOfException) { ... } catch (AnotherKind) { ... } catch (AThirdKind) { ... } Option 2 (his): try { ... } catch (AppException e)...

Should you test an external system prior to using it?

Note: This is not for unit testing or integration testing. This is for when the application is running. I am working on a system which communicates to multiple back end systems, which can be grouped into three types Relational database SOAP or WCF service File system (network share) Due to the environment this will run in, the...

HTTP POST with URL query parameters -- good idea or not?

I'm designing an API to go over HTTP and I am wondering if using the HTTP POST command, but with URL query parameters only and no request body, is a good way to go. Considerations: "Good Web design" requires non-idempotent actions to be sent via POST. This is a non-idempotent action. It is easier to develop and debug this app when the...

DAL design

I'm using .Net enterprise library data access application block for my Data Access layer design. In my Category DAL class, I've methods like : GetProductsInCategory(int CatId), GetAllProducts, GetCategories, etc. My question is: where do i put this line of code ? DatabaseFactory.CreateDatabase("MyDB"); shall i put it in every met...

Implementing friend (available in C++) functionality in C#

Ok, let's leave the debate of whether friendship breaks encapsulation, and actually try elegantly come up with a coherent design. It is a two fold function: 1) General question on how to implement: public class A { friend class B; } 2) Why do I need this functionality? Some of my classes implement ISerializable inter...

Determine number of elements of each type in a heterogeneous containercontainer

Hello, I use Dictionary as a heterogeneous container: Dictionary<string, Object> _Table; It basically maps some description to int/double/string/ISerialiazable/etc types. I want to efficiently calculate number of elements of each type, and then only print the elements of that type -- in SQL, I would group by type, then print coun...

Why are strings copied in .NET?

Since strings are immutable in .NET, why are they copied for simple operations such as Substring or Split? For example, by keeping a char[] value, int start and int length, a substring could be created to simply point to an existing string, and we could save the overhead of copying the string for many simple operations. So I wonder, why ...

Storing GPS locations in a database varchar field

I'd be grateful for any advice that anyone has regarding: How you you effectively store a gps (or any floating point number) in a varchar field that can be indexed. Background: We develop a content management system that can effectively store files of any type together with a collection of metadata. This file/metadata is stored as ...

Elegant way to read business rules stored in XML file

I have to read business rules stored in XML file (I am using VC++/MFC/MSXML). XML consists of rules. Each rule has a set of conditions and actions. What would be an elegant OOP design for such system? What design patterns would you use if you where a designer of such system? update: Rules are put in sequence and executed one buy one if ...