By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

How should one write a plug-in interface?

P: n/a
How should one write a plug-in interface?

I've tossed around several ideas but rudimentary ones at best. For
example:

Plug-In-A -Plug-In-Proxy -Application

The plug-in simply hands off its information such as author,
description, functions, parameters, et cetera to the proxy -- the
application then polls the proxy at runtime.

Does this seem like a reliable method? Smart? Efficient?

Any and all help is greatly appreciated.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Sep 15 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
-Lost wrote:
How should one write a plug-in interface?

I've tossed around several ideas but rudimentary ones at best. For
example:

Plug-In-A -Plug-In-Proxy -Application

The plug-in simply hands off its information such as author,
description, functions, parameters, et cetera to the proxy -- the
application then polls the proxy at runtime.

Does this seem like a reliable method? Smart? Efficient?

Any and all help is greatly appreciated.
There are all kinds of plugins. Exactly what you're trying to do would
be a big help.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Sep 15 '08 #2

P: n/a
Response to Jerry Stuckle <js*******@attglobal.net>:
There are all kinds of plugins. Exactly what you're trying to
do would be a big help.
Terribly sorry, Jerry, I didn't think it was important. Or rather,
I'm trying to (in general) understand a good method for
implementing plug-ins so thought specifics didn't matter.

However, I'm going to spin yet another CMS. The idea is I'd like
to roll it out fairly bare bone and in the near future add on the
other features I had planned -- therefore I needed a system of
adding functionality "on-the-fly" so to speak. I just don't seem
to be able to wrap my head around it or the ideas I have come up
with seem a bit too primitive.

Right off the bat I'm thinking 2 main types of plug-ins:

1) The plug-in returns its contents to the application front-end(a
Web page) and thusly gives the user more options to choose from or
new content (like an RSS feed, photo stream, et cetera).

2) The plug-in offers entirely new functions to the application --
this is one of the ideas I was having difficulty with. How would I
make the application "self aware" giving it the ability to utilize
new functions without running them through an "init." This one is
probably for the trash bin... or I'm over thinking it entirely.

Actually, maybe I should ask: what is the best method of rolling
out an application where I can simply drop in another page of code
that interacts with the primary application without having to re-
code the primary application.

Is this still too vague? Sorry if this is a bit incoherent still.
I've got the ideas down -- sometimes I don't convey them well.

Thanks for your patience!

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Sep 15 '08 #3

P: n/a
-Lost wrote:
Response to Jerry Stuckle <js*******@attglobal.net>:
>There are all kinds of plugins. Exactly what you're trying to
do would be a big help.

Terribly sorry, Jerry, I didn't think it was important. Or rather,
I'm trying to (in general) understand a good method for
implementing plug-ins so thought specifics didn't matter.

However, I'm going to spin yet another CMS. The idea is I'd like
to roll it out fairly bare bone and in the near future add on the
other features I had planned -- therefore I needed a system of
adding functionality "on-the-fly" so to speak. I just don't seem
to be able to wrap my head around it or the ideas I have come up
with seem a bit too primitive.

Right off the bat I'm thinking 2 main types of plug-ins:

1) The plug-in returns its contents to the application front-end(a
Web page) and thusly gives the user more options to choose from or
new content (like an RSS feed, photo stream, et cetera).

2) The plug-in offers entirely new functions to the application --
this is one of the ideas I was having difficulty with. How would I
make the application "self aware" giving it the ability to utilize
new functions without running them through an "init." This one is
probably for the trash bin... or I'm over thinking it entirely.

Actually, maybe I should ask: what is the best method of rolling
out an application where I can simply drop in another page of code
that interacts with the primary application without having to re-
code the primary application.

Is this still too vague? Sorry if this is a bit incoherent still.
I've got the ideas down -- sometimes I don't convey them well.

Thanks for your patience!
Yes, it's very important - there are almost as many ways of writing
plugings as there are programmers coding them. Asking which is the
"best way" is like asking which is the "best car" for you.

In a function oriented system, normally there are two ways to interact.
The application has a specific set of functions which can be called,
often at certain times. Additionally, there are specific callback
functions the application can call or files the application can include
specific times. Which functions/files are specified via functions in
the application and/or configuration files.

An object oriented system works somewhat differently. Typically there
are predefined objects in the application. The user derives new objects
from the existing ones to change functionality. The system again has
functions and/or configuration settings which allow the user to specify
the new objects to be used.

There are other ways, also. But what I would really recommend is
looking at a couple of the existing CMS's and see how their user
interface works. I suspect it will quickly dissuade you from writing
your own. Even the simplest CMS's are complicated to implement.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Sep 15 '08 #4

P: n/a
Response to Jerry Stuckle <js*******@attglobal.net>:

<snip>
Yes, it's very important - there are almost as many ways of
writing plugings as there are programmers coding them. Asking
which is the "best way" is like asking which is the "best car"
for you.
Those are the kind of analogies I can get behind -- thank you.
In a function oriented system, normally there are two ways to
interact.
The application has a specific set of functions which can be
called,
often at certain times. Additionally, there are specific
callback functions the application can call or files the
application can include specific times. Which functions/files
are specified via functions in the application and/or
configuration files.

An object oriented system works somewhat differently. Typically
there are predefined objects in the application. The user
derives new objects from the existing ones to change
functionality. The system again has functions and/or
configuration settings which allow the user to specify the new
objects to be used.
MANY thanks! This is the perspective and "professional hint" I
needed.
There are other ways, also. But what I would really recommend
is looking at a couple of the existing CMS's and see how their
user interface works. I suspect it will quickly dissuade you
from writing your own. Even the simplest CMS's are complicated
to implement.
Ugh, I did! I also decided what the heck and chose to peruse the
"how to write a WordPress plug-in" article.

I'll play the stubborn goat though and keep at it. I'll make sure
to point you to it for a critique if I ever make something of it.

Thanks for your feedback. It's most definitely appreciated.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Sep 15 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.