Terminology: module or class?

D

deko

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;

#endregion

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

Jon Skeet [C# MVP]

deko said:
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"

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top