design

From which classes should I derive my custom DataAccessLayerException and DuplicateEntryException?

I want to add DataAccessLayerException and DuplicateEntryException classes. But I'm in big doubts of which classes should I derive from? For example DataAccessLayerException (will be used as a wrapper for exceptions thrown from data access layer) may be derived from Exception or DbException. But I'm afraid that DbException should be the ...

Is shared ownership of objects a sign of bad design?

Hi all, Background: When reading Dr. Stroustrup's papers and FAQs, I notice some strong "opinions" and great advices from legendary CS scientist and programmer. One of them is about shared_ptr in C++0x. He starts explaining about shared_ptr and how it represents shared ownership of the pointed object. At the last line, he says and I quo...

What is wrong with this class? (design wise)

Following up from this question: http://stackoverflow.com/questions/1962175/designing-application-classes What is wrong (from a design point of view) with this class: I'm trying to refactor this class and it's abstract base class (Logon) and the fact it's actually horrible design. I wrote it myself (pretty much when I was a newbie). ...

Lessons that walk through how applications have been designed and the thought processes involved?

I'm a developer with about 3 years experience. I'm fairly proficient in a couple of programming languages, have built a few small to medium sized apps and have read books on design patterns etc. For someone in my position wanting to learn a lot more about how to build programs well and understand all the design decisions involved, I can...

Reactor, Leaders/followers , Proactor - Client/Server

Hey, I'm looking to implement a pretty scalable client-server program. I look into 3 patterns, and my conclustion were : Reactor - pretty efficient but i have 2 concerns : 1. doesn't take advantage of multipreccosor machine (it's basically single threaded) 2. if one of the hooking methods are blocking, the entire application is blocke...

Is XPath a better a way to read configuration file than using SAX / DOM parsers?

Is XPath a better way to read configuration file than DOM and SAX? If yes, Why does not log4j uses XPathExpression to read configuration file? If No, What method should I choose so that I do not have to modify the code if my configuration file changes? Update: @kdgregory Normally you are aware of the parameter you are seeking in a ...

A upgradable approach to design a web application system

Many poeple have online startups in their head that may potentially attracts millions, but most of the time you will only have minimal budget (time and resource) to start with so you want to have it delivered within a year's time. Short after launch, you are bound to perform one or a series of upgrades that may include: code refactor to ...

android layout question

Hi, Currently I'm working on a dialog which consists of title, description, tags and footer. The title can be long and in this case the text should automatically be displayed in multiple lines. The description is also longer and should fill multiple lines. At the bottom of the dialog has to be the footer (also if the title and descripti...

How to design a Javascipt Library?

Hello guys, We have just started our new assignment - web-based project. Before I get directly on to the question it would be necessary to explain about the project. We are actually moving a product from desktop to web. This is it. All backend services are web services. Our choice of server technology will be .NET. As we are good with ...

Multiple inheritance on different template types

Hey, I'm working on event handling in C++ and to handle notification of events, I have a class EventGenerator which any class generating events can inherit from. EventGenerator has a method which other classes can use to add in callbacks and a method to call the callbacks once an event happens To handle notification of different types ...

IE7 CSS/Js Bugs...Help!

I'm helping a friend do a little jquery, and along with that is some simple CSS work...but I'm no CSS expert, and things (as usual) are acting a fool in IE7--I think they are fine in IE8, but the client needs it to work in IE7...ahem. I forgot to mention specific problems: The Main nav contains a drop-down. In IE7 it doesn't work. Th...

C# WPF GUI Design Question: Is it a bad idea to attach a background worker to a specific window

Hi I have an app which consist of three windows. Main Window Settings Window Find Window A dll needs to be initialized. THis is little time consuming, so i have it done via the backgroundworker. The backgroundworker is a private member of Main Window. I need to check the status of the backgroundworker in the find window too. I can ...

Is the Mediator must hold a view in PureMvc ?

Hi all i have one question about pureMvc. i uew pureMvc to build an engine, in the engine init part i have an requirement 1) moduleA must init firt 2) moduleB , moduleC need init after moduleA init complate. 3) moduleD need init after moduleB & moduleC init complate. 4) moduleA , moduleB , moduleC , moduleD all extends Proxy beacu...

What's wrong with Java Date & Time API?

Very often I come across negative feedback on Java Date and other date-time-related classes. Being a .NET developer, I cannot fully (without having used them) understand, what's actually wrong with them. Can anybody shed some light on this? ...

How to implement exchange rate in PHP?

How does major sites implement this? Do they hardcode the rate or look it up each time? ...

Function before form or form before function?

What do you believe in? As an incomplete basis for a good product - would you prefer a mess of code that is horrible to look at but works perfectly for what its supposed to do, or a beautiful set of well organized classes (or something else if OO doesn't float your boat) but have buggy functionality that still needs a lot of work? If yo...

Flex Changing DataGrid Highlight Color

Hello How can i change the color, when the user mouse over an item on datagrid or tilelist. Basically once the user mouse overs and once the user selects a file. How to change the default color to something else. The default is blue and i dont like it :) Thanks. ...

iPhone - UITextView should look like a UITextField

Hello! I need a textfield so an user could write several lines. Unfortunately a UITextField does not provide several lines, so I think I have to use an UITextView. But the design of both are not the same. Is it possible to design the UITextView like the UITextfield standard with white background and rounded corners? Thanks a lot in a...

When should I use a ThrowHelper method instead of throwing directly?

When is it appropriate to use a ThrowHelper method instead of throwing directly? void MyMethod() { ... //throw new ArgumentNullException("paramName"); ThrowArgumentNullException("paramName"); ... } void ThrowArgumentNullException(string paramName) { throw new ArgumentNullException(paramName); } I've read that calli...

how to allow for a flexible UI in ASP.NET MVC

We are starting a new ASP.NET MVC project and we would like to establish a pattern of development that will allow flexibility in the UI. The general idea is that we would like to develop a set of related controls as a unit (i.e. a set of inputs and a submit button) and maintain the flexibility to decide later 1 of 3 UI options Have t...