Hi, I am writing an application and am creating a plug-in interface
for it.
The application will need to 'find' the plug-in's and will then need
to find all accessible methods.
The corresponding methods will need to have a corresponding 'user
friendly' name.
Eg: public void goForward() {...} will need to have a user friendly
name of "Go Forward"
I was thinking of creating an enumeration of custom objects (or maybe
string arrays ) that will store both the method name (for reflection)
and the associated friendly name.
This however seems a bit clunky. Am I on the right track or is there
any better way to do this? 11 1754
Ian,
The idea behind plug-in architecture is that you have one interface, from
which all plugins must derive, and then instantiate. Your calling program
will then know what methods are available, and what to do with them.
This way all a program needs to know is the location of the plugin (easy if
you just enumerate through the .DLL files in a plugin folder say), then call
the methods on the interface, and let the plugin do it's thing.
Does that make sense?
I've got some code you can look at if you like... http://www.dunesand.com/blog/developer/developer.htm
let me know if you need any more help with that.
Later.
Dan.
"Ian" <he******@hotma il.com> wrote in message
news:e7******** *************** ***@posting.goo gle.com...
Hi, I am writing an application and am creating a plug-in interface
for it.
The application will need to 'find' the plug-in's and will then need
to find all accessible methods.
The corresponding methods will need to have a corresponding 'user
friendly' name.
Eg: public void goForward() {...} will need to have a user friendly
name of "Go Forward"
I was thinking of creating an enumeration of custom objects (or maybe
string arrays ) that will store both the method name (for reflection)
and the associated friendly name.
This however seems a bit clunky. Am I on the right track or is there
any better way to do this?
If you have a function in your interface that has a generic sounding name,
e.g. DoWork()
You could create an attribute that can be used to supply a more meaningful
name.
The value of this attribute can be determined at runtime.
[FriendlyDescrip tion("This operation creates a fuzzy warm feeling while you
wait")]
public void DoWork()
{
}
Chris
"Daniel Bass" <I'm really @ sick of spam> wrote in message
news:O4******** ******@TK2MSFTN GP12.phx.gbl... Ian,
The idea behind plug-in architecture is that you have one interface, from which all plugins must derive, and then instantiate. Your calling program will then know what methods are available, and what to do with them.
This way all a program needs to know is the location of the plugin (easy
if you just enumerate through the .DLL files in a plugin folder say), then
call the methods on the interface, and let the plugin do it's thing.
Does that make sense?
I've got some code you can look at if you like... http://www.dunesand.com/blog/developer/developer.htm
let me know if you need any more help with that.
Later. Dan.
"Ian" <he******@hotma il.com> wrote in message news:e7******** *************** ***@posting.goo gle.com... Hi, I am writing an application and am creating a plug-in interface for it.
The application will need to 'find' the plug-in's and will then need to find all accessible methods.
The corresponding methods will need to have a corresponding 'user friendly' name.
Eg: public void goForward() {...} will need to have a user friendly name of "Go Forward"
I was thinking of creating an enumeration of custom objects (or maybe string arrays ) that will store both the method name (for reflection) and the associated friendly name.
This however seems a bit clunky. Am I on the right track or is there any better way to do this?
"Daniel Bass" <I'm really @ sick of spam> wrote in message news:<O4******* *******@TK2MSFT NGP12.phx.gbl>. .. Ian,
The idea behind plug-in architecture is that you have one interface, from which all plugins must derive, and then instantiate. Your calling program will then know what methods are available, and what to do with them.
This way all a program needs to know is the location of the plugin (easy if you just enumerate through the .DLL files in a plugin folder say), then call the methods on the interface, and let the plugin do it's thing.
Does that make sense?
I've got some code you can look at if you like... http://www.dunesand.com/blog/developer/developer.htm
let me know if you need any more help with that.
Later. Dan.
Thanks for that Dan, I gave that some thought, but soon dismissed it
as I won't know what functions the 3rd party developer is going to use
- and they need that flexibility.
Looking at your code however has given me a couple of ideas, it may
actually be the path to head down.
Ian.
Ian,
Why is that? I ask because this really breaks the whole idea of having an
OOD.
What's your scenario that this would not work in?
Later.
Dan.
"Ian" <he******@hotma il.com> wrote in message
news:e7******** *************** ***@posting.goo gle.com...
Thanks for that Dan, I gave that some thought, but soon dismissed it
as I won't know what functions the 3rd party developer is going to use
- and they need that flexibility.
Looking at your code however has given me a couple of ideas, it may
actually be the path to head down.
Ian.
"Daniel Bass" <I'm really @ sick of spam> wrote in message news:<#f******* *******@TK2MSFT NGP11.phx.gbl>. .. Ian,
Why is that? I ask because this really breaks the whole idea of having an OOD. What's your scenario that this would not work in?
Later. Dan.
I am a great fan of using interfaces - I've come from a Java
background where they're used extensively. I also believe they would
work very well in my situation.
The reason I initially dismissed it was I thought it would be more
..netish(?) to not restrict the 3rd party plug-in developer into using
c#. A more appropriate option would be COM (wouldn't it?). Based on my
knowledge (albeit very little in the grand scheme) of .net, an
interface wouldn't work in this scenario. Please feel free to correct
me.
Due to my limited knowlege and my want to get something developed
ASAP, I am now starting to believe it would be better to focus on
using interfaces and restricting the plug-in developer to using c#.
"Daniel Bass" <I'm really @ sick of spam> wrote in message news:<#f******* *******@TK2MSFT NGP11.phx.gbl>. .. Ian,
Why is that? I ask because this really breaks the whole idea of having an OOD. What's your scenario that this would not work in?
Later. Dan.
Giving it even more thought (brain about to pop), COM support is prob
a bad idea in total. .net support however is possibly a good idea.
That way, if a user want's to use vb or c++ they can. Would this (from
what I can tell - inexperience is now glowing brightly) affect me
using interfaces?
Ian wrote: Due to my limited knowlege and my want to get something developed ASAP, I am now starting to believe it would be better to focus on using interfaces and restricting the plug-in developer to using c#.
If your code is CLS compliant, the end user can consume your components in
any .NET language.
--
There are 10 kinds of people. Those who understand binary and those who
don't. http://code.acadx.com
(Pull the pin to reply)
COM is also based on the interfaces concept...
The host needs to know what to call on the plugin, either way.
..Net is great for this sort of thing. If you're not sure the plugins will
only be using .Net, then create a .Net plugin that is a COM proxy, which
will then allow others to use the native COM interface if they wish. I've
recently done this and it all works really well.
If you unsure about all this, make sure you sit down and plan it first. It's
something that requires design and thought before just going at it.
Good luck!
Dan.
"Ian" <he******@hotma il.com> wrote in message
news:e7******** *************** ***@posting.goo gle.com...
"Daniel Bass" <I'm really @ sick of spam> wrote in message
news:<#f******* *******@TK2MSFT NGP11.phx.gbl>. .. Ian,
Why is that? I ask because this really breaks the whole idea of having an OOD. What's your scenario that this would not work in?
Later. Dan.
Giving it even more thought (brain about to pop), COM support is prob
a bad idea in total. .net support however is possibly a good idea.
That way, if a user want's to use vb or c++ they can. Would this (from
what I can tell - inexperience is now glowing brightly) affect me
using interfaces? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: David MacQuigg |
last post by:
I'm not getting any feedback on the most important benefit in my
proposed "Ideas for Python 3" thread - the unification of methods and
functions. Perhaps it was buried among too many other less important
changes, so in this thread I would like to focus on that issue alone.
I have edited the Proposed Syntax example below to take out the
changes unecessary to this discussion. I left in the change of
"instance variable" syntax (...
|
by: emma middlebrook |
last post by:
Hi
I want to find out what objects are due to receive an event i.e. those
that have added themselves as an event handler via +=. Yes, it's a
little pointless perhaps (or can anyone give some good uses for
this?!!).
How do I do this for an event on a class I implement? Also, how may I
do this for an event in the .Net framework e.g. a control?
|
by: Anders K. Jacobsen [DK] |
last post by:
Hey
I have been givin the job the extend an asp.net c# application with and
extensive but very poor documented business layer. There are aprox 1200
methods like: FindAvailAmount, GetAllEmployee etc.
But as far as I can see many of the methods aint ever used. Is there a way
to traverse the layer and name methods that never called from any location
in the source code?
|
by: Per Bolmstedt |
last post by:
(This question has been asked previously in this group, but I don't
think it was ever really properly answered.)
I want to use reflection - preferably - to find all Web Forms in my web
site that inherit my base page class (which in turn inherits
System.Web.UI.Page). Behold the following code:
For Each asm As System.Reflection.Assembly In
System.AppDomain.CurrentDomain.GetAssemblies()
For Each mdl As System.Reflection.Module In...
|
by: Allan Ebdrup |
last post by:
I would like to use reflection to find all classes that inherit from my
current class, even if they are in another assembly I want to find them if
the current project has a reference to that assembly.
The reason for this is that I want to check some attributes of all child
classes and have the base class react to this information in the child
classes.
Is this possible in an easy way, or do I have to traverse all loaded
assemblies and...
| |
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= |
last post by:
Hi
I have a user control that is designed as below.
I am creating these User Controls Dynamically in another form. They are
multiple types of User Controls all with a common Interface so I can use a
Factory to create them all in a generic way.
The problem is that if I create a IMyInterface - I cannot access the
derived UserControl Methods.
I need to access the Methods derived from UserControl and also the Interface
|
by: Frank Rizzo |
last post by:
Is there a setting in VS2005 to quickly locate methods that are unused
(maybe through compiler warnings)? If not, any utilities out there that
do that?
Thanks
|
by: csharpuser |
last post by:
Does anybody know how to disallow the direct invokation of a private method using reflection but still allow the invokation through reflection of a public method which uses the private method.
To be more explicit lets take an example. Having the following methods in a class:
public void UpdateMyStuff(string data)
{
//transform input data and call the private method
UpdatePrivately(transformedData);
}
|
by: johanatan |
last post by:
When I first heard about these new features, I was very excited as it
would have (if implemented as I had expected) rendered mimicking
multiple inheritance almost painless in C#. Unfortunately, due to a
couple limitations of the language, MI is still not attainable (at
least not succinctly).
1 - Interfaces cannot define data (only properties)
2 - Extension methods cannot be used to mix in property definitions
(or implement interface...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |