Subj : architecture strategy: JSAPI or XPCOM? To : netscape.public.mozilla.jseng From : Jason Date : Fri Feb 11 2005 03:44 pm After running across some info on XPCOM I find myself at a decision point on whether to use XPCOM & am looking for advice. Here's my situation: I have some custom electronics ("DSPC", never mind what it stands for) which is connected to a Windows PC via a serial port. I would like to control this electronics using various interfaces, primarily via a standalone Javascript-based shell (ala jsshell), Perl, MATLAB, and/or C++, to allow its use by various people in my company who have different "favorites" among these sets of tools. My plan until recently was for us to create a Windows DLL which acts as the common link from the PC to the electronics, then to create minimalist wrappers for each of the other programs. (I will be working w/ another software engineer, my job is to architect the system, try out various concepts, his is to give me implementation assistance.) I will probably need to do a DLL anyway as MATLAB does support DLLs but does not seem to support XPCOM. Conceptually I would need to create just a couple of objects, e.g. DSPC, Logfile, Signal. Is it generally easier in such a case to use JSAPI + jsshell & manually create / instantiate the wrapper Javascript objects, or to make things XPCOM-ready and then automatically suck them in using xpcshell? It appears as though there is already support to use XPCOM in Perl (http://plxpcom.mozdev.org/docs/xpcom-perl.html) and that the methods for accessing XPCOM via Javascript (or at least the xpcshell version of it) are also fairly easy. Unfortunately, my head is spinning with not understanding how the XPCOM approach would work (what files are generated which would contain the actual code, and how does xpcshell know about them?); the JSAPI / jsshell approach is fairly straightforward (I've already ported over one part of functionality which works quite nicely) but seems like it would be quite a bit of extra work to write the wrapper stuff using JSAPI, compared with making a C++ class which complies with the XPCOM guidelines & adding the requisite XPCOM overhead. (e.g. XPCOM overhead is one thing per module, whereas JSAPI overhead is one thing per object.) .