design

Question regarding factory pattern

I have a factory class to build objects of base class B. The object (D) that uses this factory receives a list of strings representing the actual types. What is the correct implementation: the factory receives an Enum (and uses switch inside the Create function) and D is responsible to convert the string to Enum. the factory receives a...

Using Active Directory to authenticate users in a WWW facing website

Hi, I'm looking at starting a new web app which needs to be secure (if for no other reason than that we'll need PCI (Payment Card Industry) accreditation at some point). From previous experience working with PCI (on a domain), the preferred method is to use integrated windows authentication which is then passed all the way through the ...

How should i organize authority code?

I have users that fall into the following Not logged in Not Verified Verified Moderator Admin All code that only admin and moderators can access (like banning) is in ModeratorUser which inherits from verified which inherits from BaseUser. Some pages are accessible to all users such as public profiles. If a user is logged in he can le...

Is there a "best" way to edit CSS?

Is there a "best" way to edit CSS? I'm looking for a designer tool. It has to "visual"... less code. Visual studio does a good job but it seems to be lacking when it comes to the actual design stage. ...

Creating DB views in Ruby on Rails

Hey guys, I'm adding reporting functionality to a project. 3 roles here: 1) Volunteers (they report what hours they volunteered) 2) Supervisors (they look at the reported stuff, note: one supervisor can view all projects) 3) Projects (Represents a work project that some collection of volunteers work on) To explain what it does: A ...

SQL Server concurrency and generated sequence

I need a sequence of numbers for an application, and I am hoping to leverage the abilities of SQL Server to do it. I have created the following table and procedure (in SQL Server 2005): CREATE TABLE sequences ( seq_name varchar(50) NOT NULL, seq_value int NOT NULL ) CREATE PROCEDURE nextval @seq_name varchar(50) AS BEGIN DECLAR...

Is it a good design to return value by parameter?

bool is_something_ok(int param,SomeStruct* p) { bool is_ok = false; // check if is_ok if(is_ok) // set p to some valid value else // set p to NULL return is_ok; } this function return true and set p to a valid value if "something is ok" otherwise return false and set p to NULL Is that a good or bad ...

Value object or not for 3d points ?

I need to develop a geometry library in python, describing points, lines and planes in 3d space, and various geometry operations. Related to my previous question. The main issue in the design is if these entities should have identity or not. I was wondering if there's a similar library out there (developed in another language) to take i...

What are good/great books on Logic Design ?

I want a couple good books that cover the subject of logic design, making computer circuits. There seems to be a lot of expensive books on logic design but it is unclear which ones are good. ...

How do you determine how coarse or fine-grained a 'responsibility' should be when using the single responsibility principle?

In the SRP, a 'responsibility' is usually described as 'a reason to change', so that each class (or object?) should have only one reason someone should have to go in there and change it. But if you take this to the extreme fine-grain you could say that an object adding two numbers together is a responsibility and a possible reason to ...

javascript logo / mascot / insignia

Does JavaScript have a mascot, logo, insignia or otherwise stylistically engaging representation or alias? If not, who would be the best person/organization to get some momentum behind this kind of thing? Doug Crockford? ...

Domain model: should things like Logging, Audit, Persistence be in it

I'm having a hard time convincing our architect that a Domain model should only have the essential elements of the business domain on it. Things like the fact that a class is persistable, that it needs logging and auditing and that it has a RESTful URI should not drive the domain model. They can be added later on, by using interfaces. ...

How to design application for multi-branches POS?

My new project is POS application that connect to database using ADSL connection (512 kbps). In each branch has own database that will enable when ADSL connection has problem. From customer requirement, this application must be WindowsForm, so I want to know, how to design this application to make it performance is good as possible? (Cu...

How to relate keywords to records - Many to Many

Hi All, I am looking for suggestions on database design for a sample jobs listing application. I have many jobs that I would like to associate various keywords with. Each job can have multiple keywords. I would like to store the keywords in a seperate table instead of in a field within the Job table so as to avoid mispellings in keyword...

Using Interceptors in Spring for Business logic concerns

I am new to working with Spring on regular basis so I had a basic design question on it. Should the concept of interceptors be used for separating out business logic in an application. E.g. A method getData is called from 3 classes/ One of the 3 needs some more processing before reaching the data. This processing is not a concern like l...

When should a member function have a const qualifier and when shouldn't it?

About six years ago, a software engineer named Harri Porten wrote this article, asking the question, "When should a member function have a const qualifier and when shouldn't it?" I found it to be the best write-up I could find of the issue, which I've been wrestling with more recently and which I think is not well covered in most discuss...

Time/resource allocation on a Stylish vs. Functional user interface

When developing applications how much focus/time do you place on an application’s style vs. functionality. Battleship gray apps drive me insane. On the other hand maximizing a business application’s "style" can tax time and financial resources. Applications need to be appealing to resell or meet basic customer expectations, but defini...

Objective-C wrapper API design methodology

I know there's no one answer to this question, but I'd like to get people's thoughts on how they would approach the situation. I'm writing an Objective-C wrapper to a C library. My goals are: 1) The wrapper use Objective-C objects. For example, if the C API defines a parameter such as char *name, the Objective-C API should use name:(...

Style Combo Boxes in Silverlight 3.0 (Expression Blend 3)

Hi, In blend I would like to style the custom look of a combo box. When I choose "edit this template as a copy" I create an instance of the control so that I can edit it. However, when I go to change the simple "base" state "style" I cannot. For example - I would navigate to the gradient section and choose to change the gradient. When...

Choosing colors that convert nicely to greyscale

If I'm designing af tool that must "screenshot" well for printed documentation, can I easily choose colors that look different even when printed in greyscale? EDIT: I was hoping for some easy-to-use palette or tool, but the inputs given already is very insightfull for sure ...