naming-conventions

In the Command pattern what do you call a command that groups together other commands?

This should be easy, I am trying to come up with the name for a command class that is a collection of other commands. All the sub commands will be run, when the master command is run. Any ideals? ...

Naming N:N connectivity tables

We have 2 object types and want to connect them N:N. For example, articles & authors. How would you name relations table? What would you put first at table name, articles or authors? (articles2authors or books2authors) Someone would, probably, recognize this question as stupid. I don't think so because I'm looking for ideal naming co...

How should I name a java.util.Map?

I have a java.util.Map that maps from a logical name to a set of parameters to use with that name. Map<String,Parameters> howShouldINameThee = ...; What is the best name for this map? Should I go simple and just call this parameters or parametersMap? Do I include information about the key in the name like paramtersByName so that ...

ASP.NET MVC Field naming convention for nested objects

I am using ASP.NET MVC 1.0. I am creating a view to Create a new object of the following class public class ClassOne { public string Name {get; set;} public string Id {get; set; } public CaptionItem Caption {get; set;} } public class CaptionItem { public string CaptionSet {get; set;} public string Text {get; set;} }...

How to name functions to extract parts of a decimal number?

I am writing a class for handling decimal numbers, e.g. "123.456". I want one function for extracting the digits before the decimal point (123), and one function to extract the digits after the decimal point (0.456). My question is not how to do the programming, but how to name the functions? Do you have any better idea than digits_befor...

Good naming convention for functions and methods which may modify (write back to) a parameter.

Hello, everyone! I need to find a good and understandable naming-scheme for routines which deal with "value arrays" (I've written something similar to C++'s valarray in Java, with some optimizations for primitive types in mind). I know that the main categorization of routines is made between: functions (they may take parameters and m...

SQL Server: conventions for naming a schema

Consider a database server whose job today is to house one database. Likely the database will be moved in the future to another database instance which houses multiple databases & schemas. Let's pretend the app/project is called Invoicer 2.0. The database is called AcmeInvoice. The database holds all the invoice, customer, and product i...

C# delegates, reference resolution time.

Hi, I have a simple question about .net delegates. Say I have something like this: public void Invoke(Action<T> action) { Invoke(() => action(this.Value)); } public void Invoke(Action action) { m_TaskQueue.Enqueue(action); } The first function encloses a reference to this.Value. During runtime,...

Is it wrong to make every concrete class to inherit from an interface ?

This is in response to certain comments made by Zed Shaw in his blog a long while ago. The experts will then saunter off to implement their Flaming Tower of Babel without any comments, horribly complex mock enabled tests, making sure EVERY SINGLE CLASS HAS AN INTERFACE, and ending every class with “Impl” because, well, th...

Can I make a Fluent NHibernate foreign key convention which includes parent key name?

I have a database schema where the convention for a foreign key's name is: ForeignTable.Name + ForeignTable.PrimaryKeyName So, for a Child table referencing a Parent table with a primary key column named Key, the foreign key will look like ParentKey. Is there a way to create this convention in my Fluent NHibernate mapping? Currently...

mSomeVar names - where from and why?

Variables in Android sources are prefixed with m, like mStream or mHeaderValueIndex. What's the rationale behind Hungarian notation here? ...

TDD: "Test Only" Methods

Looking for some practical advice here and any experiences people have had in a similar situation. We use a BDD/TDD sytle methodology for building our software (quite a large/complex application) The end result is.. behavioral specifications (Given/When/Then style) derived from business requirements, unit tests that reflect these and co...

Non-uppercase constants in Java

This question about why constants in Java are uppercase by convention made me try to think of counter examples. I can think of at least one (Double.NaN). Are there others? ...

Variable names of unordered set items without implied structure

This question will be asked in a specific form, but applies to a more general question, how to name unordered set items without implying any sort of structure. In terms of graph theory, a connected, undirected graph will contain vertices that are connected via edges. When creating an edge class with two member variables that are vertic...

putting a capital 'I' in front of JAVA interfaces

Many years ago when I was at uni they said to put a capital i (I) in front of interfaces. Is this still a convention because I see many interfaces that do not follow this. ...

asp.net MVC DisplayTemplates and EditorTemplate naming convention

Hi, I've got a couple of questions about the naming convention for the DisplayTemplates and EditorTemplates in MVC 2. If for example I have a customer object with a child list of account how do I: Create a display template for the list of accounts, what is the file called? When I'm doing a foreach( var c in Model.Accounts ) how do I ...

How should I name an "umbrella" type sanely?

This has "always" bothered me... Let's say I have an interface IFiddle and another interface that does nothing more than aggregate several distinct IFiddles: public interface IFiddleFrobbler { IFiddle Superior { get; } IFiddle Better { get; } IFiddle Ordinary { get; } IFiddle Worse { get; } IFiddle Crackpot { get; }...

What name should have method which returns number of nested objects?

Suppose we have classes Gallery and Image. There can be many images in one gallery. Gallery should have some method which returns number of nested images. My suggestions: int getImagesCount (); int countImages (); int imagesCount (); I saw examples of each of these 3 suggestions in different APIs (of course with another noun or ev...

How do you set singular/plural forms for table names like news?

It's frequently seen in YAML: User: tableName: users columns: ... foreignAlias:User And things like that. But what if the table is called news?How will you make it distinguish-able? ...

fileName or filename?

Possible Duplicate: Parameter naming: filename or fileName? What do you use - filename or fileName? The classes in the JDK use a lower case 'n', e.g. FilenameFilter, so, for consistency, I do too. But the correct way, I believe, should be fileName (as in C#). ...