Terminology: module or class?

Terminology: module or class?

Post by deko » Thu, 28 Jul 2005 07:41:57

I'm new to C# and trying to get a handle on terminology.

In the below class, I declare variables that are intended to be visible to
all members of the class. Are these:

"Module-level variables"
"Class-level variables"
"Member-level variables"

Or should they be called "Member-level declarations"?

namespace MyNamespace
public class MenuData
#region Module Level variables (?)

private string strMenuItem;
private string strMenuType;
private decimal decUnitPrice;


public MenuData(string MenuItem, string MenuType,
decimal UnitPrice, string PhotoFile,int MenuID)
strMenuItem = MenuItem;
strMenuType = MenuType;
decUnitPrice = UnitPrice;
[code omitted]

Terminology: module or class?

Post by Jeff Loui » Thu, 28 Jul 2005 08:43:31

I can only guess that you are trying to declare class level variables
that are
visible to all INSTANCES of a class. So called static variables are part
of the class



*** Sent via Developersdex http://www.yqcomputer.com/ ***


Terminology: module or class?

Post by Jon Skeet » Thu, 28 Jul 2005 15:20:14

They're instance variables, according to the C# specification. If they
had the static modifier, they'd be static variables.

A module in .NET is part of an assembly - most assemblies have a single
module containing all the types in that assembly. It's possible,
however, to have a multi-module assembly. These are very rare - partly
because VS.NET doesn't support them (you have to create them from the
command line).

Jon Skeet - < XXXX@XXXXX.COM >
http://www.yqcomputer.com/ ~skeet
If replying to the group, please do not mail me too