Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Step by step to create dlls to hold two levels of subcla
Message
De
08/10/2007 11:26:29
 
 
À
07/10/2007 21:21:17
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01259275
Message ID:
01259460
Vues:
18
>Thank you for the explanation which was very understandable and clears up a lot of stuff.
>
>Congrats on the .NET MVP. You have certainly been "most valuable" to me.


Glad to help, Alex. And thanks! =0)

~~Bonnie


>>First, the namespace issue ... I recommend that you don't use iBusiness (since, as you've noticed, "I" is used for Interfaces). The best way to differentiate between the Framework classes, your Intermediate classes (I wondered what the "i" stood for <g>) and your Application classes , is in the rest of the namespace.
>>
>>So, your namespace might be something like SosaCia.Intermediate.Business and SosaCia.MyApp.Business and the class would still be BrokenRulesCollection (no reason to precede it with anything extra, as the namespace differentiates it from the StrataFrame class).
>>
>>We actually break it down one step further in our namespaces, because I find you will more than likely need more than one Business DLL. So, we have something like this (the names are obviously not these, other than the TiburonInc part of it <g>):
>>
>>
>>TiburonInc.MyFramework.Business.BaseClasses
>>TiburonInc.MyFramework.Business.OtherClasses
>>
>>
>>and then our applications would have:
>>
>>
>>TiburonInc.MyApp.Business.Personnel
>>TiburonInc.MyApp.Business.Assets
>>
>>
>>Likewise with the other "layers" ... DataAccess, DataSets, WebServices, WinUI or WebUI.
>>
>>Now, the next thing ... yeah, Visual Studio creates a class called class1.vb, but you obviously should name it something more appropriate. Yes, you can add all the classes you want into that file.
>>
>>Source Control adds a complexity only if your StrataFrame DLLs are not in the GAC or in a centralized location. The reason it adds a complexity is because when you add your references to the StrataFrame DLLs, the path to the DLLs is hard-coded into your .vbproj file. The way around that, if you need to, is to go to the Properties of the Project, and click on the Reference Paths page. Here you would need to add the paths to the DLLs you are adding references to. In this way, an additional file is created, .vbproj.user, which should *NOT* be under Source Control. Then, when you add the References, you'll find them under the .NET tab rather than having to Browse to them. Again, this is only if they're not in the GAC and not in a centralized location that everyone accesses.
>>
>>~~Bonnie
>>
>>
>>
>>
>>
>>>Thank you very much for the response, Bonnie. I hope you have the time and patience to go a little deeper.
>>>
>>>Taking a specific case: with the help of Intellisense I can see that Strataframe Business.dll has a large number of classes, one of which is MicroFour.StrataFrame.Business.BrokenRulesCollection.
>>>
>>>Lets say I want to organize the classes inherited form the MicroFour.StrataFrame.Business namespace into the SosaCia.iBusiness namespace (or would you suggest a different namespace scheme?) From your response I created a class project called iBusiness and added a reference to "MicroFour StrataFrame Business.dll" Visual Studio automatically added a file class1.vb to the project. Can I simply add the code to create the subclasses right in the class1.vb file or is there a more recommendable way?
>>>
>>>Code in class1.vb
>>>
>>>Public Class iBrokenRulesConnection
>>>    Inherits MicroFour.StrataFrame.Business.BrokenRulesCollection
>>>End Class
>>>
>>>
>>>I will be using Source Control (Subversion). How does that affect the process?
>>>
>>>By the way, do you think the convention I have been using: prefacing class names with "i" for intermediate or "a" for application (a convention originally recommended by YAG when VFP 3.0 came out) may lead to confusion with the use if "I" prefix meaning interface used in the .NET world?
>>>
>>>Thanks a lot for the help.
>>>
>>>Alex
>>>
>>>
>>>>Alex,
>>>>
>>>>It's not quite as easy in .NET. You wouldn't be able to create a sub-class-library, which is what you're showing in your VFP example.
>>>>
>>>>Each Project in a .NET Solution will be compiled to a .DLL. But a Project is not actually sub-classed from another DLL. You'll need to create classes in your Project that inherit from each of the Framework classes.
>>>>
>>>>So, you create your IBusiness Project, IBusiness, which will end up compiling into an IBusiness.DLL. Then, you create a class (right-click the Project, Add | Class), then change the code to this:
>>>>
>>>>
>>>>public class MyBizClass : Business.FrameworkBizClass
>>>>{
>>>>}
>>>>
>>>>
>>>>Do this for every class in the Business.DLL that you wish to sub-class. You can either put all the new classes in one file in your new Project, or you can have a separate file for each class in the Framework class. It will probably depend on what class you're sub-classing.
>>>>
>>>>You will also have to add a reference to the Framework class library (right-click the Project, Add References) ... how you do this part depends on whether your Framework classes reside in the GAC, anywhere on your PC or in a central depository accessed by all developers, and also depends on whether you're using Source Control.
>>>>
>>>>~~Bonnie
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>This is a very basic/newbie question.
>>>>>
>>>>>We are starting a .NET application using Strataframe framework. In the past (with VFP) I've had good results following the advice to subclass a purchased framework twice: once to be to shared among several apps and once again specific to an app.
>>>>>
>>>>>It's been suggested that I create a dll for each level of inheritance classes. Where can I find step by step instructions to create dlls that hold each of the two levels of subclasses? Don't be embarrased that your suggestion is too basic :) I am asking how to do the equivalent of these VFP steps:
>>>>>
>>>>>MD c:\IFramework\Classes
>>>>>CREATE CLASSLIB C:\IFramework\Classes\IBusiness.vcx
>>>>>CREATE CLASS IBusiness OF C:\IFramework\Classes\IBusiness.vcx AS Business FROM c:\Framework\Classes\Business.vcx
>>>>>
>>>>>And then later,
>>>>>MD c:\MyApp\Classes
>>>>>CREATE CLASSLIB C:\MyApp\Classes\ABusiness.vcx
>>>>>CREATE CLASS ABusiness OF C:\MyApp\Classes\ABusiness.vcx AS IBusiness FROM c:\IFramework\Classes\IBusiness.vcx
>>>>>
>>>>>Thank you.
>>>>>
>>>>>Alex
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform