conventions

Is there a convention, when using Java RMI, to use the dollar sign $ in a variable name?

I realize that it is a valid part of a variable name, but I've never seen variable names actually use the symbol $ before. The Java tutorial says this: Additionally, the dollar sign character, by convention, is never used at all. You may find some situations where auto-generated names will contain the dollar sign, but your variable ...

Where is the JavaBean property naming convention defined?

The Spring Framework API doc says: The convention used is to return the uncapitalized short name of the Class, according to JavaBeans property naming rules: So, com.myapp.Product becomes product; com.myapp.MyProduct becomes myProduct; com.myapp.UKProduct becomes UKProduct. I looked at Suns website to find a definition, but didn't ...

Why is there a convention of 1-based line numbers but 0-based char numbers?

According to TkDocs: The "1.0" here represents where to insert the text, and can be read as "line 1, character 0". This refers to the first character of the first line; for historical conventions related to how programmers normally refer to lines and characters, line numbers are 1-based, and character numbers are 0-based. I hadn't ...

Objective-C NSThread ref counting convention (retain vs autorelease)

My main program spawns a thread, which executes the following: // alloc autorelease pool somewhere before NSArray *blah = [NSArray arrayWithObject: @"moo"]; [self performSelectorOnMainThread: @selector(boonk:) withObject: blah waitUntilDone: NO]; // release autorelease pool somewhere after Now, this seems buggy to me because the...

Register a single class for multiple closed versions of a generic interface in StructureMap using the scanner.

Here are the relevant types and an example of the handler I want linked to IHandle<EventA> and IHandle<EventB>: // marker interface public interface IEvent {} public interface IHandle<TEvent> where TEvent : IEvent { void Handle(TEvent e); } public class SomeHandler : IHandle<EventA>, IHandle<EventB> { public void Handle(EventA...

C# conventions / best practices.

Hello, I was wondering is constantly reusing namespace names is valid for c# conventions/best practises. I am develop most of my programs in Java, and i would have a packet for implementations, eg: com.ajravindiran.jolt.game.items.sql com.ajravindiran.jolt.game.users.sql com.ajravindiran.jolt.events.impl com.ajravindiran.jolt.tasks.im...

Name of a path containing the complete file name?

For me, a path was always something that "walks the way to something", but without the "something". Like a chicken following bread crumbs until it hits the target. But the target is not part of the path. That's what I believe. So, example: C:/foo/bar = the path. C:/foo/bar/something.html = Path and the "Target". Can someone tell me wh...

How malleable are the conventions in ASP.NET MVC?

Specifically, does a controller class name have to have the Controller suffix, and can you change the folder structure in your project if you want to, without breaking things? Are there other conventions that can be overridden, and how? ...

Software stack for convention based ASP.NET MVC development

Besides ASP.NET MVC's obvious conventions, what libraries do you take advantage of that minimize boot strapping, mapping objects, data access and such? I want to spend more energy developing domain logic as opposed to dealing with the details of object persistence (for example). I have used StructureMap and NHibernate in the past to gr...

Including large JS library with :cache => true into a rails app

Hi, I am thinking about the best way of including a JS library into rails app supporting :cache => true option for both JS and CSS. Let me take an example to describe the question: jQueryUI (that's just an example). It usually has the following structure when downloaded: +jq.ui +css +skin1 +images all_...

How should I setup my homepage in django?

I'm not familiar with django conventions at all so if you do provide advice could you be specific Considering my homepage would contain components of articles: In Zend, in my IndexController I would create models and populate the view with articles and data. What's a convention/structure I could use for the homepage view ( sh...

What are common conventions for using namespaces in Clojure?

I'm having trouble finding good advice and common practices for the use of namespaces in Clojure. I realize that namespaces are not the same as Java packages so I'm trying to tease out the conventions in Clojure, which seem surprisingly hard to determine. I think I have a pretty good idea how to split functions into clj files and eve...

Naming conventions - in which namespace do subclasses go?

Hypothetically, if I have: Contoso.App.People.SecurityGuard : Contoso.App.People.Person And I then build this class and ship it as a core lib. If I then consume this library in, say, a mobile client app and make a: NightDeskGuard : Contoso.App.People.SecurityGuard In which namespace would the new class go? Contoso.App.Mobile.Peopl...

Why creating protected properties in beans is counted a bad practice?

What I mean is: public class SomeBackingBean { protected String someString; public void setSomeString (String str) { this.someString = str; } public String getSomeString { return someString; } } It was just a general case for a general answer. Now second example: public abstract class AbstractBean<T ...

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...

ASP.NET MVC Conventions

ASP.NET MVC is heavily convention-based, "convention over configuration" as they say. So, this means there's a lot of significance to what name things are given and where in the project structure they are created. As a newcomer to ASP.NET MVC, I appreciate the power and simplicity of this approach, but I do find it a bit confusing to ke...

Stack calling convention between .NET & C on WinCE 6.0

Hi there. I'm porting a DLL written in C from WinCE 5.0 to WinCE 6.0 on an ARM target. This DLL is called by a .NET software. On WinCE5.0, everything runs fine. On WinCE6, I have the following problem: on InitInstance() of my DLL, I can call anything without problem (for example MessageBox()) or uses recursivity. Passed that point, th...

Python 3 object construction: which is the most Pythonic / the accepted way?

Having a background in Java, which is very verbose and strict, I find the ability to mutate Python objects as to give them with fields other than those presented to the constructor really "ugly". Trying to accustom myself to a Pythonic way of thinking, I'm wondering how I should allow my objects to be constructed. My instinct is to hav...

Where should the line between property and method be?

Possible Duplicate: Properties vs Methods For many situations it is obvious whether something should be a property or a method however there are items that might be considered ambiguous. Obvious Properties: "name" "length" Obvious Methods: "SendMessage" "Print" Ambiguous: "Valid" / "IsValid" / "Validate" "InBounds...

Namespace Orginization and Conventions

So I have a little bit of a problem. I working on a project in C# using The StackOveflow API. You can send it a request like so: http://stackoverflow.com/users/rep/126196/2010-01-01/2010-03-13 And get back something like this JSON response: [{"PostUrl":"1167342", "PostTitle":"Are ref and out in C# the same a pointers in C++?", "...