Administrator
VB.NET Forum Admin
- Joined
- Jun 3, 2004
- Messages
- 1,462
- Programming Experience
- 10+
I have my main project, then several Class libraries which are commonly used for various apps in my business. So let's take for example a class library, fictional name: "Widgets.DLL"
In this DLL are various classes, all of which are scoped as FRIEND. This is done as I use Preemptive Dotfuscator Professional which makes reading code in Friend classes virtually impossible so it hides my "how I did that" very well.
From my main project I access the methods in Widgets.DLL via a Factory class. This allows me to pass parameters into the Friend classes and return values, etc. via the Public Factory Class. So we'll call it Public Class MyFactory.
I use a separate constructor that requires a password to be passed in to access the methods, if the password is incorrect an exception is thrown. This all works fantastic, no problems at all, intent is met. However, the problem I have is I have a gazillion methods that are not organized very well as they are all within MyFactory. So MyFactory.GetHelp and MyFactory.GetFiles and MyFactory.EncryptThis blah blah blah is all at the same level and makes finding methods to do things harder.
I'd love to organize this in a more hierarchical approach such as grouping by IO, GDI, DATA so I could use MyFactory.IO.GetFiles or MyFactory.GDI.ConvertImage.
I obviously cannot use namespaces, the only thing I can think of are nested classes. The problem then, if I am correct, is each nested class would require its own constructor, or would it? (I haven't tried).
The objective is to password control access to MyFactory so only my apps (my business) can use my class libraries I create. Is there a way that I can organize this factory and use one password to access the DLL, or am I going to have to pass a password and constructor for each and every nested class?
So VB.NET guru's, what's the best way to organize a library under these constraints?
In this DLL are various classes, all of which are scoped as FRIEND. This is done as I use Preemptive Dotfuscator Professional which makes reading code in Friend classes virtually impossible so it hides my "how I did that" very well.
From my main project I access the methods in Widgets.DLL via a Factory class. This allows me to pass parameters into the Friend classes and return values, etc. via the Public Factory Class. So we'll call it Public Class MyFactory.
I use a separate constructor that requires a password to be passed in to access the methods, if the password is incorrect an exception is thrown. This all works fantastic, no problems at all, intent is met. However, the problem I have is I have a gazillion methods that are not organized very well as they are all within MyFactory. So MyFactory.GetHelp and MyFactory.GetFiles and MyFactory.EncryptThis blah blah blah is all at the same level and makes finding methods to do things harder.
I'd love to organize this in a more hierarchical approach such as grouping by IO, GDI, DATA so I could use MyFactory.IO.GetFiles or MyFactory.GDI.ConvertImage.
I obviously cannot use namespaces, the only thing I can think of are nested classes. The problem then, if I am correct, is each nested class would require its own constructor, or would it? (I haven't tried).
The objective is to password control access to MyFactory so only my apps (my business) can use my class libraries I create. Is there a way that I can organize this factory and use one password to access the DLL, or am I going to have to pass a password and constructor for each and every nested class?
So VB.NET guru's, what's the best way to organize a library under these constraints?