COM Interop -- Class Library vs. EXE

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I am developing classes in C# that are called from PHP via COM. The C# code
does a lot of work to establish internal data structures, and I would like
these data structures to persist so that I do not have to recreate them each
time the COM code is called.

For example, imagine a function MyObject.BuildInternalDataStructures() which
takes a long time. Another function, MyObject.UseInternalDataStructures(),
is called repeatedly. The first time UseInternalDataStructures is called,
it detects that the structures haven't been built, so it calls
BuildInternalDataStructures. Subsequent calls to UseInternalDataStructures
do not need to incur the penaly of building the internal data structures.

The problem is that on my web server, PHP instantiates a new instance of my
object each time a PHP page is hit -- and destroys the object (and unloads
my DLL) when the page completes executing. So the next time the user hits a
PHP page that calls out to MyObject.UseInternalDataStructures(), it has to
rebuild everything again from scratch.

Is there a way to build a COM server as an EXE, so that it can run in the
background, maintaining its state, while allowing COM consumers (such as
PHP) to call into it?

Thanks

Greg


.



Relevant Pages

  • Re: [OT] Is OO incompatible with the three tier architecture
    ... >> reality dictates that you use the LIMIT option which is can only be ... Where is PHP ... you can populate objects and data structures on ... You pays yer money and you ...
    (comp.lang.php)
  • Re: COM Interop -- Class Library vs. EXE
    ... I think it is a simple matter of moving your data structures to a static ... Once the CLR is loaded, it is not going to be unloaded for the ... > I am developing classes in C# that are called from PHP via COM. ... > object each time a PHP page is hit -- and destroys the object (and unloads ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: [PHP] OT - RE: [PHP] scalable web gallery
    ... Subject: [PHP] OT - RE: scalable web gallery ... In spite of this mental exercise, I do *NOT* miss my Data Structures ... Haven't taken a distributed computing class just yet, ...
    (php.general)
  • Re: structures in php ?
    ... > How do you create data structures in php? ... > Structure SYSTEMTIME ... PHP does not have support for Structures or structs in the traditional ... live their lives governed not by rules but by reason. ...
    (comp.lang.php)
  • Re: Validating form input data
    ... When the user hits the 'Submit' button, ... You may want to take a look at this forms generation and validation ... Metastorage - Data object relational mapping layer generator ... PHP Classes - Free ready to use OOP components written in PHP ...
    (comp.lang.php)