design

Shortening a "Long" parameter list.

I'm refactoring one of my projects - a shopping cart. One of the tightly coupled areas of my code is the "Viewer" class - to generate information for the user to see, it often needs a combination of two or more of the following objects: The store catalog. The customer's order. The customer's mailing information. I can't really brea...

Is down-casting 'this' to a derived class is correct?

Hello, Have a class Hero. Sometimes I need a deep copy (when all members are copied by value) of this class as a kind of some derived class: class Hero { public: // members, w/o getters/setters public: // Constructors Hero(); Hero(...) ~Hero(); inline SuperHero* asSuperHero() { ...

Designing software at complex levels?

Hi, I'm writing a software that appears to be quite a lot more complex than I realized earlier. It performs several sub-tasks, has a set of entirely different tasks and integrates itself to other applications, modules and programming languages. There are hundreds of todo's I need to do, and everything seems a bit too complex to think st...

Fields and properties Best Practice in C#

Dear all, which one is the best practice using C# and why? 1. private string name; public string Name { get { return name; } set { name = value; } } 2. public string Name { get; set; } 3. protected string name; public string Name { get { return name; } set { name = value; } } 4. Please add ... ...

Dependency Injection, Unit Testing, and Information Hiding

Suppose you have a class Foo with private member of type Bar. You don't want users to know that Foo's implementation contains a Bar and you don't want users to be able to create their own Bar and pass it through Foo's constructor, any other method, or a configuration file. Edit: Bar is also problematic in that it accesses resources ...

Domain Model Financial Trading application

Hello; my company is thinking about implementing a new financial compliance trading application which is an application that would check all trades that would be executed by the company. A very simple check might be "Don't Invest in Stocks that sell Alcohol" for example. We need to define a financial business object model and then d...

C# Language Design: explicit interface implementation of an event

Small question about C# language design :)) If I had an interface like this: interface IFoo { int Value { get; set; } } It's possible to explicitly implement such interface using C# 3.0 auto-implemented properties: sealed class Foo : IFoo { int IFoo.Value { get; set; } } But if I had an event in the interface: interface IFoo ...

Best database solution for managing a huge amount of data

I have to design a traffic database which includes data from different towns (8 towns) 2mb in a period of 10 min for each town 24h. The incoming data is the same for all Town. So my first question is what is better on the performance side: design one database for all towns with many tables (one table for each town) or design many databas...

WDSL - at what stage of the project would you expect delivery?

Hi, I'm working on my first project using an external supplier, who will develop some web services for the company I work for. My question is - at what stage of the project lifecycle would you expect the WDSL (and any associated Schemas) to be delivered? Personally, I think it's a service contract, so I wouldn't expect it to be unre...

Free Web UI design software

Does anybody know of any free Web UI design software? EDIT: I am looking for a UI mockup tool (that is freeware) to create stuff like this: http://blogs.atlassian.com/jira/Mockups%20UI.jpg I works a developer with the task to design the UI of an application. I want to draw some examples of how the webpages can look and show it to the r...

When to use an abstract class with no interface?

Whenever I create an abstract class I tend to create an interface to go along with it and have other code refer to the interface and not the abstract class. Usually when I don't create an interface to start with I regret it (such as having to override all implimented methods to stub the class for unit testing or later down the line new ...

Grails domain classes design issue

How i must design my grails application? My business rules must be implemented only within services (with anemic domain classes, only with getters and setters) or must exist a consensus, putting domain business rules in domain classes and services? ...

What has been your most helpful Software Design/OOP Metaphor?

I am re-reading Code Complete (Second Edition) since I read it in College. I got to the Second Chapter about the importance of metaphors and was curious what metaphor is/was most helpful to you in understanding software design/construction? I was looking for metaphors focused on Polymorphism, Inheritance, Encapsulation and Design Patter...

A big, green UIImage anyone?

According to this post, there is a stretchable UIButton image that is red. Does anyone have a green one? (My Photoshop skills are very poor.) ...

SOA and WCF design questions: Is this an unusual system design?

Hello all. I have found myself responsible for carrying on the development of a system which I did not originally design and can't ask the original designers why certain design decisions were taken, as they are no longer here. I am a junior developer on design issues so didn't really know what to ask when I started on the project which...

Handling updates to data In your API

Assume I have a feed of data ordered by an "ordering" field. This data is fed to a consumer via API, and the consumer caches it locally. Now, let's say I correct a typo in an entry that has already been cached by the consumer, but need the consumer to pick it up. The content I'm feeding them is ordered by "ordering", and they won't be...

Presenting / explaing code and design decisions to team members

I am working on a project where I will have to regularly justify and explain my code and design decisions to team members who are not directly involved in the same area of the project as I am. How can I best explain my technical design decisions to team members in a different location? Are code walkthroughs worth the time for team memb...

Database design issue:

Hey guys, I'm building a Volunteer Management System and I'm having some DB design issues: To explain the process: Volunteers can sign up for accounts. Volunteers report their hours to a project (each volunteer can have multiple projects). Volunteer supervisors are notified when a volunteers number of hours are close to some specified ...

I'm designing a game for my forum. Not very sure about my strategy...

I have a small community of members inside a forum. For the sake of entertainment, I a planning to introduce a small game based on reputations. The idea is that send updates to a user (X) about another user (Y) based on how much X ranks Y. This is just a fun game, but the way I thought of implementing it was in one of the following ways:...

What is wrong with this design? Overriding or overloading of java.util.HashMap

This question was asked to me in MS interview. I wanna know the exact design issue in this piece of code. Code was already given, needed to find the design issue. I have class MyHashMap which extends java HashMap class. In MyHashMap class I have to keep some information of employees. Key in this map will be firstName+lastName+Address...