473,395 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

best way to implement dynamic design

hey all,

I'd like to implement an application that is truly dynamic: the
components are not only just known at runtime, but also the components
are unknown at runtime: ie: some don't even ship with the application.

When a new component is shipped, the application 'picks up' that
component and drops it in to the interface (in this case a GUI button
as well as an associated class with that gui buttion). The application
then uses the code in that interface to customize the behaviour of the
application.

Sort of like a 'skin' - except instead of having external data
customizing the look of an application, there is external code
customizing the *behaviour* of an application. However, since there

Also, I need this to be cross-platform so, if there is no internal
solution to this problem (the language doesn't support it) I'm
interested in solutions that work on MacOSX/Linux/Win. I'm using
wxWindows as my GUI platform.

Or - should I maybe go with wxPython instead?

jon
Jul 19 '05 #1
3 1991
tt*******@yahoo.com (jonathan) wrote in message news:<f0**************************@posting.google. com>...

This is an ISO C++ newsgroup, which doesn't even support GUIs, let
alone loading arbitrary code at run-time (which some systems do not
support).

Then again, I'm not sure if there *is* a forum for this, so I'll start
rambling so that you have some stuff to look up, at least.

Anyone interested only in ISO C++ should probably stop reading now. :)
I'd like to implement an application that is truly dynamic: the
components are not only just known at runtime, but also the components
are unknown at runtime: ie: some don't even ship with the application.
There must be, at least, a published interface/protocol so that you
can ask the module what it can do and how to get it to do that.
Also, I need this to be cross-platform so, if there is no internal
solution to this problem (the language doesn't support it) I'm
interested in solutions that work on MacOSX/Linux/Win. I'm using
wxWindows as my GUI platform.
Java apps use a feature called "reflection" for this purpose; but C++
doesn't support anything like reflection (yet), so this has to be done
by the programmer. Further, ISO C++ doesn't support dynamic modules,
since not all systems support dynamic modules (ISO C++ is designed to
run on just about any computer). So, you're left with OS-specific
technologies.

On Windows, COM and ActiveX are commonly used for this sort of thing.
On Linux, GNOME uses Bonobo, which is a CORBA-based technology; and
KDE uses KParts.

I have no idea about MacOS X. :) Maybe, if you're lucky, one of the
Linux technologies is also portable there.

You might be able to use one or more of these technologies, perhaps
using different ones on different platforms. Alternatively, it may be
possible to write your own component architecture, but such will be
non-trivial (for a place to start, look up LoadLibrary on Windows and
dlopen on Linux [and possibly MacOS X via its FreeBSD heritage]).
Or - should I maybe go with wxPython instead?


That sounds like the easiest way to do it, if that'll work for you. It
certainly makes sense to use a dynamic language like Python to add
dynamic behavior to a program.

In fact, you might be able to write the program and modules in C++ and
use Python to glue them together -- those wacky people at boost.org
have a C++/Python reflection library, which may be of some use here.
It officially supports Windows and Linux, but it may be portable to
MacOS X if someone (you?) makes it happen.

I have no idea if any of this is relevant to you, but hopefully it'll
lead you in the right direction.

Good luck!

- Shane
Jul 19 '05 #2
jonathan wrote:
Did you have a C++ question?

Please read the Welcome message:

http://www.slack.net/~shiva/welcome.txt

-Kevin

Fair enough, but I maintain that what I asked in fact *was* a C++
question - it dealt with the limitations of the language. The extra
stuff (about guis, etc.) is just context.


I don't really see a question about C++. The whole thing with drop-in
components can't possibly be done in standard C++ since there's no
concept of dynamic linking or anything like that. Unless maybe the
components were interpreted by the main app somehow.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #3
jonathan wrote:
Did you have a C++ question?

Please read the Welcome message:

http://www.slack.net/~shiva/welcome.txt

-Kevin


Fair enough, but I maintain that what I asked in fact *was* a C++
question - it dealt with the limitations of the language. The extra
stuff (about guis, etc.) is just context.


In this case, the answer is "what you want cannot be done".

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rhett | last post by:
Hello,EveryBody! I'm troubled by a design problem, Hoping that you'll save me out! The Situation is: We have two project of code A and B.A is our reusable code base, B is for specified for...
6
by: Charles Law | last post by:
This is going to seem like a basic OO question, but it comes up and bites me every now and again. Suppose we have a multi-tiered protocol to implement, what is the logical, OO way to design the...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: Jordan | last post by:
I'm converting a section of our website into the .NET framework (the rest will follow sooner or later). I'd certainly like to maintain all the dynamic capabilities as well as implement some new...
9
by: Mike Hofer | last post by:
BACKGROUND: We've designed a Website for a client that will be deployed across multiple physical locations. The site will be hosted from a corporate NOC, and administered by the IT group there. ...
4
by: Ronald S. Cook | last post by:
We're about to design am enterprise Windows app. Since it will have lots of modules, we're thinking about a listbar (like Outlook) on the left with menu bar across the top, and status bar at the...
4
by: =?Utf-8?B?bW9mbGFoZXJ0eQ==?= | last post by:
In VB6, we created a number of ActiveX DLLs that all shared a similar interface. The main application would load these in dynamically (late-bound.) This worked well for our situation because we...
7
by: Chris | last post by:
Hi All, This is a weird one but I am hoping someone can help or has some pointers, a recipe how to do the following: I have to move some code from c++ to objective-c and to do this I must...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.