design

Which is better for a rails site? /{login} or /user/{login}

Which is better (for the user, for longevity, for performance, for whatever) to have: http://{site}/{login} e.g. http://wildobs.com/adam_jack or http://{site}/user/{login} Pros of former: User feels more special. URLs are shorter. Cons of former: Cannot have users w/ logins matching keywords, and keywords likely grow over time....

Why specify primary/foreign key attributes in column names

A couple of recent questions discuss strategies for naming columns, and I was rather surprised to discover the concept of embedding the notion of foreign and primary keys in column names. That is select t1.col_a, t1.col_b, t2.col_z from t1 inner join t2 on t1.id_foo_pk = t2.id_foo_fk I have to confess I have never worked on any databa...

Mutable vs immutable objects

I'm trying to get my head around mutable vs immutable objects. Using mutable objects gets a lot of bad press (e.g. returning an array of strings from a method) but I'm having trouble understanding what the negative impacts are of this. What are the best practices around using mutable objects? Should you avoid them whenever possible? ...

Why is Predicate<> sealed?

I wanted to derive a class from Predicate<IMyInterface>, but it appears as if Predicate<> is sealed. In my case I wanted to simply return the inverted (!) result of the designated function. I have other ways to accomplish the goal. My question is what might the MS designers have been thinking when deciding to seal Predicate<>? Without m...

Better to return a C++ reference or a weak_ptr?

Suppose I have a class where I want the user to be able to have a reference to one of my members. Which is preferred? class Member; class ClassWithWeakPtr { private: boost::shared_ptr<Member> _member; public: boost::weak_ptr<Member> GetMember(); }; or class Member; class ClassWithCppReference { private: Member _member; pu...

User interface for text mode LCD display

Does anybody know any resources on this subject? I'm developing an embedded application for 2x16 LCD display. Ideally I would like to have a general (display independent) framework, that could be used virtually on any display - one or more segment(s) LED, 1x16, 2x16 LCD, etc. Also would like to learn about general guidelines for such sm...

HTML Links and Usability

Should links on a web page ALWAYS be underlined? I do not believe this should be a hard and fast RULE! I wrote a comment on my blog awhile back about this after another developer complained that I was not following web standards. It is coming up again, and I want to know what you think. Her argument was that for consistance and usabilit...

Database Localization - Lookup lists - smarter way

I'm looking to add some lookup lists in the database, but I want them to be easy localizable (SQL 2005, ADO.NET) This would include: Easy Management of multiple languages at the same time Easy Retrieval of values from the database Fallback language (in case the selected language is missing) I was thinking about having a table that w...

database design and program design

How is database design different from program design? ...

Java Application/Class Design - How do accessors in Java work?

How do I write the getDB() function and use it properly? Here is a code snippet of my App Object: public class MyApp extends UiApplication { private static PersistentObject m_oStore; private static MyBigObjectOfStorage m_oDB; static { store = PersistentStore.getPersistentObject(0xa1a569278238dad2L); } pub...

Sharing Assemblies

Hi A have a design question. I have wrote a couple of c# applications. Most of these apps have their own sql or access database, but then they also share a common database, but they are entirely different apps which have their own responsibilities in their own business domains. Some people I spoke with believe the following : Applicati...

User Interface design books/resources for programmers

Hi, I'm going to make my monthly trip to the bookstore soon and I'm kind of interested in learning some user interface and/or design stuff - mostly web related, what are some good books I should look at? One that I've seen come up frequently in the past is Don't Make Me Think, which looks promising. I'm aware of the fact that programme...

How to inherit constructors?

Imagine a base class with many constructors and a virtual method public class Foo { ... public Foo() {...} public Foo(int i) {...} ... public virtual void SomethingElse() {...} ... } and now I want to create a descendant class that overrides the virtual method: public class Bar : Foo { public override void Somet...

Design questions for an OOP library in Lua

I implemented a small OOP library in Lua, and two things are not quite right yet. I need your advice! How to call super()? I need to make a choice. The three arguments I need to resolve a call to super() are: The class from where the call is being made (CallerClass) The instance to be passed (self) The name of the method (method) ...

Client Customizations

We have a product with an install base of about 50, over 50% of these installs have customizations in the code for the business logic, and that is currently done by huge IF and Switch statements. We are currently in the process of updating the code to .NET 3.5 and would like to handle the customizations in a more managable way. The onl...

Is it acceptable to "borrow" dependency properties from unrelated classes?

I'm writing a class that renders some content in WPF, and I want to give the user control over how the content is rendered. The rendering is mostly stroking lines, so I decided to look to the System.Windows.Forms.Shapes.Line class to get an idea of what properties I might want to implement. This led me to implement most of the StrokeXX...

What is the best example of a Web site that offer programming tutorials to teach beginners how to program?

Hi We are looking to create programming tutorials to teach new developers how to get started with programming. But we aren't sure of what "format" and "layout" really works best. We needs some good examples of what works best. ...

Class design for serialization - ideas or patterns?

Let me begin with an illustrative example (assume the implementation is in a statically typed language such as Java or C#). Say you are building a content management system (CMS) or something similar. The data is hierarchically organised into Folders. Each folder has a collection of children; a child may be a Page or a Folder. All items...

Design for scalability/performance/security etc..

Most of the design articles and books are focused on getting loosely coupled and highly cohesive software.. A general guideline not to design for performance but just write code that is efficient. The performance can later be fixed at hot-spots. I am talking in term of rich-domain applications.. What about scalability and security? Wh...

What are best practices for designing XML schemas?

As an amateur software developer (I'm still in academia) I've written a few schemas for XML documents. I routinely run into design flubs that cause ugly-looking XML documents because I'm not entirely certain what the semantics of XML exactly are. My assumptions: <property> value </property> property = value <property attribute="attv...