Re: Creating a plug-in based WebApp

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thanks for your informative inputs Joseph,

Really appreciate the article you provided about setting additional probing
path, I did haven't noticed that before...

Mats,

Do you have further idea based on Joseph's experience sharing...

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Joseph Ferris" <joseph.ferris@xxxxxxxxx>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: Creating a plug-in based WebApp
| Date: 29 Nov 2005 07:38:43 -0800
| Organization: http://groups.google.com
| Lines: 89
| Message-ID: <1133278722.982191.261610@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
| References: <u2wa1BF8FHA.3592@xxxxxxxxxxxxxxxxxxxx>
| <1132766375.357736.282560@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
| <O5lmniF8FHA.3752@xxxxxxxxxxxxxxxxxxxx>
| <PIzBwYN8FHA.4000@xxxxxxxxxxxxxxxxxxxxx>
| <ORYdYua8FHA.952@xxxxxxxxxxxxxxxxxxxx>
| <q$vTtW#8FHA.3764@xxxxxxxxxxxxxxxxxxxxx>
| <#8Ip6QG9FHA.4076@xxxxxxxxxxxxxxxxxxxx>
| <upSyqeN9FHA.832@xxxxxxxxxxxxxxxxxxxxx>
| NNTP-Posting-Host: 63.144.130.226
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1133278728 11694 127.0.0.1 (29 Nov 2005
15:38:48 GMT)
| X-Complaints-To: groups-abuse@xxxxxxxxxx
| NNTP-Posting-Date: Tue, 29 Nov 2005 15:38:48 +0000 (UTC)
| In-Reply-To: <upSyqeN9FHA.832@xxxxxxxxxxxxxxxxxxxxx>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322; .NET CLR 1.0.3705),gzip(gfe),gzip(gfe)
| Complaints-To: groups-abuse@xxxxxxxxxx
| Injection-Info: g43g2000cwa.googlegroups.com; posting-host=63.144.130.226;
| posting-account=Vd0Hbg0AAAC6U1lJ_giny8wVIgM0jjCa
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!postnews.google.com!g43g2000cwa.googlegroups.com!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:361488
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven,
|
| I've been following this thread, as I have been working on a similar
| application to what Mats is describing. I have a CMS with a dynamic
| plugin architecture that hasn't gotten much beyond the proof of concept
| stage.
|
| But, what I have a question about is:
|
| > In addition, as for
| > =============
| > If I add <probing privatePath="AnotherBin"/> to my .config file and
| > touch a file there, will the application restart itself then too?
| > =============
| >
| > this is not possible, because the ASP.NET's runtime is a particular
| > customized CLR host, it is forced to use the "bin" as the only private
| > probing path (no matter what we set in the web.config....) .
|
| I have been able to get this to work, though. The catch is that you
| can not just add the values to the privatePath attribute, but you also
| must add an <%@ Assembly %> and <%@ Import %> directive on the ASPX
| page.
|
| There is a brief article about this at:
|
http://www.hanselman.com/blog/PermaLink.aspx?guid=4d0ef4fb-f8ae-4355-a658-3c
0432c98dbe
|
| This did not work for me, as that defeated the purpose of dynamically
| included ASCXs. Touching the ASPX pages to include all possible
| controls (which are analyzed and have creation information stored in
| the database) would become make for a page that is too large and prone
| to error. This technique is more for a team of developers working on a
| single solution that is broken into multiple projects that might change
| at varying frequencies.
|
| What I ended up doing was (I am working off the top of my head, since I
| don't have access to my home development machine from the office), I
| created a base control class that inherited from UserControl, where I
| extended it with some creation and data loading code. I also created
| an Interface that all controls which inherit from my base must also
| implement, so that I ensure that the system can talk to them.
|
| To create them, I have implemented an Abstract Factory pattern and
| created an object which creates any control that implements my
| interface and also is a type of my object, based upon the information
| stored in the database and the type of content the page should be
| displaying. So far, it is working well - although I will be the first
| to admit that I have a long way to go until it does something useful
| (like return data to the screen!). ;-)
|
| Like you, Mats, I have been struggling with a way to organize my bin,
| as well as allow the worker process to be able to see my changes.
| Right now, my test app is able to load a control from a subdirectory of
| bin by using LoadControl. To be honest with you, I have no clue how I
| was able to get it to work. I had struggled with it for a better part
| of the weekend. ;-)
|
| The way that my solution is set up is that I have a "Library" project
| that contains my framework. I also have a main solution that is the
| web site itself. It is really small and lightweight, since most of the
| functionality is in the Library. My plugin that I have been playing
| with is stored in two places. The ASCX is in a subdirectory of the web
| site, in this particular case, it is in ./Template/Default. (My
| plugins can either be widgets, or templates, or a couple of other types
| of specific objects.) The DLL from the Plugin's project is in the bin
| folder of the web site at the moment.
|
| While it works, I was hoping to get a more granular structure, as well.
| I am not sure for your reasoning, but I am guessing that it is similar
| to mine. I am looking for plugin segragation. Since I might not be
| the one developing a plugin, I don't have control over things such as
| naming, etc. If I could "sandbox" them, I could have a little more
| piece of mind. Of primary concern is the use of third party controls
| in relation to a third party control from the app. Isn't that a
| confusing way to put it? ;-) What I meant to say is if PluginA uses
| CompanyZ's WonderWidget, as does PluginB, I now have to implement some
| sort of reference counting to be able to determine when I can remove
| the WonderWidget unless I can come up with a sound and secure way of
| organizing the plugin "installs".
|
| Anyhow, I have rambled on enough for you, I am sure. When I get to
| looking at my code again, I'll see if there is anything that I didn't
| mention. Unfortunately, taking the commute to work into account, I
| don't have much time for my project until the weekends.
|
| Thanks for reading!
|
| Joseph
|
|

.



Relevant Pages

  • Re: Creating a plug-in based WebApp
    ... I use masterpages to load my addins and I wrote a special Loader webcontrol that takes the name of the addin to load as a parameter. ... The addins in their turn look at the parameters they got and adds the correct .ascx file to its control collection. ... To restart the web application I'll probably resort to using an external program that installs the correct addins and then touches a file in the bin dir. ... My plugin that I have been playing ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Creating a plug-in based WebApp
    ... created a base control class that inherited from UserControl, ... Like you, Mats, I have been struggling with a way to organize my bin, ... My plugin that I have been playing ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: MFC Design Q
    ... If the main application holds the tree, and the plugin will send messages to ... You said that the plugin cannot handle GUI events (for example, ... User right click on a tree control item and a context menu is poped up: ...
    (microsoft.public.vc.mfc)
  • Re: Problem in LoadPlugins in Application
    ... other words control is accessible or loaded in to memory... ... MainForm when clicks on corresponding plugin button. ... SomePlugin is a class library projects which contains 3 UserControls.Every ... usercontrol in anther panel. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Pinball Mats - Anyone know if this guy is still around
    ... he is still around or did they send the muscle in to rough him up and things ... got out of control? ... I am just looking for a bunch of mats for my game room. ...
    (rec.games.pinball)