naming-conventions

JavaScript RegExp: R naming conventions

We're all familiar with naming conventions in R (if not: Venables & Smith - Introduction to R, Chapter 1.8). Regular expressions, on the other hand, remain terra incognita and the most hated part in my programming life so far ... Recently, I've officially started JavaScript recapitulation, and I'm trying to create precise RegExp to check...

ReSharper complains about uppercase "ID" in member "EntityID"

I have a property "EntityID" in a class. Resharper (5.1) says Name 'EntityID' does not match rule 'Methods, properties and events'. Suggested name is 'EntityId'. But IMHO according to the naming conventions in the Design Guidelines for Class Library Developers. 'EntityID' should be perfectly fine: Do not use acronyms th...

Naming convention for common patterns?

Hi all, Just as there is a naming convention for the Observer pattern (or rather, a naming convention for events in languages such as C#) using Event/Handler passing EventArgs and such, are there naming conventions that you use to easily highlight other patterns in your code? edit: I originally wanted to ask about the Strategy pattern,...

How to name factory like methods?

I guess that most factory like methods start with create. But why are they called "create"? Why not "make", "produce", "build", "generate" or something else? Is it only a matter of taste? A convention? Or is there a special meaning in "create"? createURI(...) makeURI(...) produceURI(...) buildURI(...) generateURI(...) Which one would...

Presentation layer and domain model classes naming conventions

What are the naming conventions you use for application domain model classes and presentation layer classes? Postfixes/Prefixes to distinguish the aim of the class from the first sight: For example information about the person that is returned from DAL can be public class PersonEntity { public Guid Id { get; set; } public SexType...

Naming practice for objects of a class in Python

I have this weird problem as to how to name objects of a class. For example, consider the class: >>> class DoSomething: pass What should I call the object of this class? do_something or what? Since I came out of the learning stage, I used to use x, y or z or whatever came to my mind. But now since I am learning to write prop...

What is the thinking behind a class called something-context?

Hi, What is the thinking behind objects named x-context (e.g. SPContext in Sharepoint, HttpContext in ASP.NET)? I would assume these objects just have methods and properties to cover everything regarding the current request (as per the two examples above), or in the case of an OrderContext object, contains details about the order relati...

naming convention suggestion for web developement

I have implemented a notification bar at the top of my web page. When the user performs an insert,edit,delete. My messages are Successfully inserted // insert or create Successfully updated // update or edit Successfully deleted // delete Is this ok. Or any other suggestion from user point of view ...

How do you name a class/package/module like...

How would you name a package who's sole purpose was to extend another module so you could apply roles to it? I need a package that extends (sub classes) Template::Context with Moose So I can then create roles and traits to apply to it, but I don't know what to name this package (class). Any advice? ...

Is this still an adapter pattern?

Hi, I stumbled upon this class and was wondering if XYZAdapter might be the correct name. I know how the adapter pattern works, but this solution is a bit different: Instead of implementing the DataTable interface and mapping the appropriate method calls, im creating a new DataTable object by copying the values and expose this object. T...

Why Java uses convention of this.member?

I quite often see the following naming convention used in java code. class SomeClass { private final String name; public SomeClass(final String name) { this.name = name; } } This seems a little odd to me. First off if you happen to misspell the variable in the method signature it will still compile... class SomeC...

Should I use (otherwise optimal) class names that conflict with the .NET BCL's names?

This situation probably is not entirely uncommon to some of you: you have some functionality to put in a class but the perfect name (*) for that class is taken by one of the classes in the System namespace or other namespace/class that's not yours but you're using/importing. (*) By perfect I mean small, concise and clear names. For ins...

Table naming convention for configuring a jdbcRealm in GlassFish

Hello, I am trying to configure a jdbcRealm in GlassFishV3 using existing tables that have a naming convention other than "users" and "groups"; the realm does not appear to work unless the tables are named this way. My question is, why the limitation? Is there a work around other than renaming my existing tables? Thanks, RG ...

are there tutorials on how to name variables?

as you can probably tell from my previous posts i have horrific naming conventions. do you know of any tutorials dealing with how to name stuff? ...

Design pattern name: Is it a factory?

The following class shows something similar to a real use case. It returns always the same instance for the same thread. public class LookingForName { private static final ThreadLocal<Something> threadLocal = new ThreadLocal<Something>(){ @Override protected Something initialValue() { ...

Naming conventions for Code Contract classes of Interface types

Hi All, I'm using the Code Contracts classes in the System.Diagnostics.Contracts namespace to define some contracts for my objects and I'm wondering how others name their contract classes when the contract is defined against a base interface. Let me illustrate with a small example: [ContractClass(typeof(AnimalContract))] public interfa...

In a tree structure, how to name the tree, the nodes, the leaves?

Hello, this question is about best practices. I'm implementing a 3D interval Kd-Tree and, because of the recursive structure of the tree I would be tempted to create a unique class, KdTree to represent the tree itself, the nodes and the leaves. However: elements are contained only at leaves, some general tree parameters (such as the ma...

Should columns in a database that have a FK/PK relationship be named?

How should columns in a database table that have a PK/FK relationship be named? Should their names contain a reference to the table they are in? Consider the examples below. Each employee has an ID which is a FK in the salaries table. /* Employees Option 1*/ CREATE TABLE dbo.Employees ( EmployeeID INT PRIMARY KEY, EmployeeFir...

Identifying an object name by appending a generic name with a changeable value. Is this possible?

Say I have 5 UIImageViews, named image1 image2 image3 image4 and image5. And I have 5 buttons, which have their tag values set to the corresponding images that overlay them, so 1 - 5. If button 1 is pressed, I get the tag value like so NSNumber buttonNumber = [sender tag]; I then want to perform some methods on the corresponding...

Why do Zend Framework Action Controllers have a Suffix?

Hello Stackoverflow, I am quite a new Zend Framework user but I am not new to PHP or Programming. I have been going through the code to try and get to grips with how everything slots together. One of the parts I have been looking at is how classes are Autoloaded in the system. I can see that: Zend_Application_Bootstrap references Zend...