design

best approach to extend a class funcionality in java?

for short, this could be paraphrased like "inheritance versus function library" for example, I'd like to add a method to the javax.servlet.http.HttpServletRequest that gives me the whole body, a getBody() method that would read the body thru the getReader method, just to put an example. In other languages, like ruby or javascript, you ...

Is deriving square from rectangle a violation of Liskov's Substitution Principle?

I am new to design and learning the design principles. It says deriving square from rectangle is a classic example of violation of Liskov's Substitution Principle. If that's the case, what should be the correct design? ...

Should class method code be accessing external variables directly?

I have certain PHP class methods that access external variables. These variables are not passed as arguments, but rather directly used by the code in the methods. One method uses a variable that is DEFINEd in a config file and whose purpose is to be available to every part of the app that needs it. This seems ok to me. The other method...

Is it ok to downcast?

I'm designing a framework which users can extend. Basically I will provide them a set of interfaces which they can implement, and my "manager" class will call their implementations like this: abstract1 = factory.GetConcreteExtension1() abstract2 = factory.GetConcreteExtension2() abstract1.DoSomething(abstract2) Where my client impleme...

What are the best web design sites?

Hello! I just wanted to know what are the best websites about web design? I'm looking for websites about either web design, CSS, Photoshop for the web or web development in general (like new web technologies). ...

Justification for using non-portable code.

How does one choose if someone justify their design tradeoffs in terms of optimised code, clarity of implementation, efficiency, and portability? A relevant example for the purpose of this question could be large file handling, where a "large file" is "quite a few GB" for a problem that would be simplified using random-access methods. ...

Recommendations for places where I can get good css designs/ web 2.0ish buttons, tables, etc...

Im designing a website, and often I need to present information in a nice table, or need a nice button, etc... I need recommendations for any websites which have a large collection of these elements which I could just use, instead of designing my own. Thanks!! ...

C#: How to cleverly design a GUI for a Desktop Application with encapsulation in mind

Hey everyone! I am developing a desktop application with a MainForm that's grown rather large. There are lots controls in several containers on different levels (SplitContainers, TabPages, Panels). Now I want to refactor this class by separating all the controller code responsible for data binding & clearing the controls or carrying ou...

Inheriting legacy COM architecture, is it any good?

Our system looks like this: One or many applications containing one or many in-process COM component(s), that communicate with some hardware via a single COM server. (Hope that makes sense - please ask if it needs clarification) The design decisions that led to this system design have been lost in the mists of time, however I think tha...

Persuading the business that fundamental design flaws are worth fixing

This is the second project I've worked on where an incorrect assumption has been made in the design of the software. In both cases it has resulted in a solution that is: More likely to get bugs related to the flaw More messy to work with as workarounds are implemented to get around it Harder to understand as the assumption does not mat...

Are web-safe colors still relevant?

Since the vast majority of monitors are 16-bit color or more, including mobile devices, does it make sense to even consider web-safe colors when choosing color schemes? Or is it something that ought to be relegated to history as a piece of trivia? For those of you that don't know what web-safe colors are: Another set of 216 color v...

database design for capturing trending keyword

Hi I need some help on creating database design for capturing and scoring trending keywords. What i have so far is: keyword_id int auto_increment keyword varchar description tinytext date_trend_started datetime mention_count int ranking int day_at_top datetime days_at_top int what else needs to be considered ...

Combobox shows up in IE6 when a grey background image is used for the page

I am facing this queer problem: what i am trying to achieve is like on page load one pop-up would be shown where users need to do something to get the page going, a grey image background is applied to the body to keep the page inactive. But in ie6 the comboboxes of the page shows active and user can select values whish is so frustrating....

Which is best for a repeating piece of code?

I have a class with two member functions that share a piece of code: void A::First() { firstFunctionEpilogue(); sharedPart(); } void A::Second() { secondFunctionEpilogue(); sharedPart(); } Currently firstFunctionEpilogue(), secondFunctionEpilogue() and sharedPart() are not function calls but just pieces of code, sharedPar...

Plugin based application in C#

Hi All, I have to make a graphical user interface application using the language of my choice. The application will run on Windows XP. It will be some sort of a complex windows form application. I think and as per most suggestions, C# will be the best to use. The tree structure on the left of the GUI will populate after reading from a ...

How Do Open Source Projects Find Designers/Artists?

I've been working on a casino game as a way to learn XNA and I'd like to publish it to an open source host. The back end is coming along rather nicely, but I'm absolutely NOT artistically inclined, whatsoever --I know of no developers that are. I'm obviously not looking to make money off of this project, so offering to pay somebody for t...

Silverlight - Examples of awesome demo applications NEEDED!

Hello, At company I'm working, new project will be started soon. I'd like to use Silverlight 2.0 but I need to convince my CEO and Photoshop/AfterEffects guy for using Silverligt for upcoming project. These persons are - let's say - rather Flash / Apple oriented, but for me as a .NET developer Silverlight seems to be proper solution :-)...

Is LINQ to Everything a good abstraction?

There is a proliferation of new LINQ providers. It is really quite astonishing and an elegant combination of lambda expressions, anonymous types and generics with some syntax sugar on top to make it easy reading. Everything is LINQed now from SQL to web services like Amazon to streaming sensor data to parallel processing. It seems like s...

How to have a local position and global position in a game.

I have a base class called Component. I also have 2 interfaces I2DComponent, and I3DComponent. I am currently working on the I2DComponent. The implementation: /// <summary> /// Represtions a 2D object. These objects will be drawn after 3D objects, /// and will have modifiers automatically provided in the editor. /// </summary> public ...

IUI way to display invalid password

I'm developing a mobile site using IUI. It's a framework that makes web pages look like IPhone dialogs. I have a tree-like catalog and on a certain level the page asks for a password to proceed. I'm not quite used to IPhone and failed to find a native dialog with a password check that can fail. What is the "IPhonic" way to handle an ...