Web Connection
Current methods for configuration processing
Gravatar is a globally recognized avatar based on your email address. Current methods for configuration processing
  Rob Corbett
  All
  Apr 13, 2017 @ 07:54am

There seems to be a lot of conflicting information in the documentation and source code comments. In our subclass of the wwServer class, I see the comment "MUST ...implement the Process and SetServerEnvironment methods to receive requests!". In the wwServer code I see that SetServerEnvironment is marked as "deprecated". I'm getting confused while trying to decipher configuration processing. Given the goal of building a REST only Server running as an out-of-process COM server (EXE), can someone explain the current recommended method for adding custom server level properties that are set from an *.ini file? Should I be adding things to wc.ini, myapp.ini, or somewhere else? What changes/additions should be made to MyAppMain.prg to process these settings? How does myapp_serverconfig.prg play into all this? What about the same for our implementations at the wwProcess class level? Thanks for any help.

Gravatar is a globally recognized avatar based on your email address. re: Current methods for configuration processing
  Rick Strahl
  Rob Corbett
  Apr 13, 2017 @ 01:58pm

The methods you should use are:

  • OnInit()
    Server initialization before the application loads config data - meant to allow you to configure where configuration and other base settings required to set initial state is done. Usually you don't touch this beyond what's generated.

  • OnLoad()
    Happens after the server has loaded the base configuration. Use this method to do most of your application configuration like SET commands, loading dependencies (SET PROCEDURE, SET CLASSLIB etc.), load up persistent connections and cached data etc.

Can you point me to where the docs talk about the old functions? The docs are pretty big and carry a lot of baggage for over 20 years of documentation 😄, so there are still a few places where the docs haven't been updated. Fixing as I run into it, but it's a massive job given the volume of docs.

The stuff in the top level User Guide has all been redone - it's usually in the crooks and crannies and FAQs that are not all covered.

+++ Rick ---

© 1996-2024