|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
project source design questionmy project. Say you have several enums, one for message types, one for email formats, one for import method, etc...things your various programs do. You obviously will have need to use these enums in the actual class that does these things, but you from time-to-time need to use them somewhere else. In that cricumstance, would you create a single Declarations module and put all your enums and global vars in there or would you put them in their separate class files as public members? I kind of like having everything come up in intellisense under a namespace.declaration.whatever, but realize it may make more structural sense to put them in the class where they are actually related to the class function. Opinions? Thanks Jon
Show quote
Hide quote
"Jon" <ruffl***@msn.com> schrieb You can put Enums at top level, i.e. in the project's root namespace:> I'm trying to decide where to put some globally accessible > declarations for my project. Say you have several enums, one for > message types, one for email formats, one for import method, > etc...things your various programs do. You obviously will have need > to use these enums in the actual class that does these things, but > you from time-to-time need to use them somewhere else. > > In that cricumstance, would you create a single Declarations module > and put all your enums and global vars in there or would you put > them in their separate class files as public members? > > I kind of like having everything come up in intellisense under a > namespace.declaration.whatever, but realize it may make more > structural sense to put them in the class where they are actually > related to the class function. > > Opinions? file "global.vb": enum myglobalenum1 a b end enum end-of-file If you want to put them into a sub namespace, you can do this also: namespace mynamespace enum myglobalenum1 a b end enum end namespace Just wanted to show that you neither have to put them into a class nor into a module. I don't use "global" variables. I usually put them into a class called "App" and make them Shared. My personal taste because I think that "global variables" are properties of the application/instance. Armin
Search Arraylist in Arraylist.
Newbie Question: How To Open A File Non-Exclusively? PropertyBag in VB.NET? Saving a Database to Disk Windows Form Application Help PostMessage and Combobox Question about Control Collection in VB.net Cast from string "" to type 'Date' is not valid Accessing controls from another thread unexpected split functionality - index out of bounds |
|||||||||||||||||||||||