design

What are the disadvantages of auto generating the classes in Hibernate

I am working in a new part of an existing system. What are the disadvantages of auto-generating the classes for Hibernate for an existing database? I just think that whatever design failures we have at the moment (and there are plenty) we will port to this new part of the system. ...

n-tier design with website and backend transaction processor.

We have a website, where transactions are entered in and put through a workflow. We are going to follow the standard BLL(Business Logic Layer), DTO(Data Transfer Object), DAL(Data Access Layer) etc. for a tiered application. We have the need to separate everything out because some transactions will cross multiple applications with differ...

Generic Parent For Generic Class

I am using a fictional example for this. Say, I have a Widget class like: abstract class Widget { Widget parent; } Now, my other classes would be derived from this Widget class, but suppose I want to put some constraint in the class while defining the derived types such that only a particular "type" of widget can be parent to a partic...

Content Voting Database and Application Design

How would you design a content voting mechanism that could be applied polymorphically to multiple models / classes. (in a ruby on rails context preferably, but others are fine) Given that instances of these classes can be voted on: - Article - Question - Product Voters should not be required to register. Best effort should be made to ...

Why do Boost libraries return things "convertible to `bool`" rather than just returning `bool`s?

Several times, while perusing the Boost library's documentation, I've run across return values that are marked "convertible to bool" (search that page for the phrase "convertible to bool", it's about a third of the way down). I once stumbled across an oblique reference to a paper explaining the reason for that, but have never been able t...

Can you find a solution using just css, to make an element centred when it appears on its own, and aligned to the right when it appears with another element?

The problem: We have a page that ordinarily has two elements arranged side-by-side. <div id="container"> <div id="element1">content</div><div id="element2">content</div> </div> But in some conditions only element2 is on the page e.g.: <div id="container"> <div id="element2">content</div> </div> Despite exploring a few angles fo...

Automatically Duplicating Business Logic on Web Client

Last week I implemented a date validation in our front end, a combination of ASP.NET and heavily dependent on lots of JavaScript code to avoid server round-trips until a form is actually saved. I felt it clumsy that this rule check is not done on the server, but our current architecture and performance requirements prevent this. It's o...

CSS for container divs and falling to the next line

Hi, I'm more of a programmer than a designer, and I'm trying to embrace DIV's rather than using tables but am getting stuck. Here's what I'm trying to do. I am setting up a survey page. I want each question's text to sit at the top of the blue div, and wrap if it's too long. I want all of the red divs to line up at the top right cor...

Change return signature via inheritance – Polymorphism

Hi guys Just wondering if there is any way to do the following: public Interface IDataField { object GetValue(); } public Interface IComplexDataField : IDataField { object GetDefaultValue(); } public class MyBase { private IDataField _DataField; public MyBase() { this._DataField = this.CreateDataField();...

Bruce Lee software design question

A friend of mine was given a fairly cryptic assignment for a software design class, using a quote from Bruce Lee as the basis: "Be like water making its way through cracks. Do not be assertive, but adjust to the object, and you shall find a way round or through it. If nothing within you stays rigid, outward things will disc...

Having some confusion with LINQ

Some background info; LanguageResource is the base class LanguageTranslatorResource and LanguageEditorResource inherit from LanguageResource LanguageEditorResource defines an IsDirty property LanguageResourceCollection is a collection of LanguageResource LanguageResourceCollection internally holds LanguageResources in Dictionary<string...

Design Questions

Hi Im building a windows app in c# and I have the following design question : I have the following object structure : Parent -> Child Collection - > Child - > Grandchild collection -> Grandchild. The use case requires that I use my Parent object in stages. Eg. Make a new instance of parent. Populate parent and save. At a later stage I...

Why seal a class?

I'd like to hear what is the motivation behind the bulk of sealed classes in the .Net framework. What is the benefit of sealing a class? I cannot fathom how not allowing inheritance can be useful and most likely not the only one fighting these classes. So, why is the framework designed this way and wouldn't it be unbreaking change to u...

Where do you draw the line between design and architecture ?

The Agile architecture question makes me wonder this. Does it depends of what is being build ? Do applications (I mean single computing program here) have an architecture ? UPDATE: to try to clarify the question, I'll give my opinion on the question: I defined the architecture as the cutting of the system in components, and t...

Where do you get XML file formats from

Looking at questions like http://stackoverflow.com/questions/77726/xml-or-sqlite-when-to-drop-xml-for-a-database and http://stackoverflow.com/questions/44207/what-are-good-alternative-data-formats-to-xml it is clear that XML is something you best use for exchanging data between systems, organizations, and software programs. For internal...

Getting started with Visual Studio Designer

Does anyone have anyone have any resources for getting started with the Visual Studio Designer and the DesignSurface? Edit: Obviously I was too vague with my first question...what I am really interested in hosting a designsurface in my own application, the intention is to provide a basic form design application to users. I was not askin...

Techniques for adding Achievements to business class software

I was thinking of adding some Achievements to our internal bug-tracking and time logging system. It's connected to an SQL Server back-end. At first I thought that the system could be run on the database, using triggers to, for example, know when: you've logged 1000 hours created 1000 tickets closed your own ticket worked on a ticket t...

Is it worth it to write a bunch of 2 liner functions in BLL object just to re-route to DAL?

It seems pretty silly to me. What don't I get? ...

Designing a Wiki, design considerations and feedback

Hi, When designing a wiki application, what things should I take into consideration? So far I have: revisions parsing some sort of markup text keeping track of links in wikis, and pages that link to other pages. related wikis i.e. wikis are related to others. What else goes into building a Wiki? ...

designing a distributed (over many servers) error logging feature, WCF or ?

Hi, I am designing a error logging feature so our servers (each donig different things) can have a central data store for logging errors. Would it be a good idea to have the various applications writing to the error log file using a WCF service, or is that a bad idea? they can do it just by ADO.NET to the database, which I think is th...