Windows Vista Forums

Global vars in different build scenarios.

  1. #1


    Adrian Guest

    Global vars in different build scenarios.

    We have a solution where one project contains a set of business rules. We
    use the rules in a web application and they're integrated into the main web
    project. Any global varaibles for the user are stored on the web session,
    and that all works fine.

    Now the fun part, we now have to be able to call these business rules from
    an old powerbuilder app, where a web server isn't available, so have to use
    a com interface layer to call the business rules. The problem is that we
    need the com class to initialise some variables and make them available to
    the rules class. I know there's not a session object, but how do you go
    about coding for the two very different scenarios that the business object
    will be living in?

    Cheers
    Adrian



      My System SpecsSystem Spec

  2. #2


    Jeroen Mostert Guest

    Re: Global vars in different build scenarios.

    Adrian wrote:

    > We have a solution where one project contains a set of business rules. We
    > use the rules in a web application and they're integrated into the main web
    > project. Any global varaibles for the user are stored on the web session,
    > and that all works fine.
    >
    > Now the fun part, we now have to be able to call these business rules from
    > an old powerbuilder app, where a web server isn't available, so have to use
    > a com interface layer to call the business rules. The problem is that we
    > need the com class to initialise some variables and make them available to
    > the rules class. I know there's not a session object, but how do you go
    > about coding for the two very different scenarios that the business object
    > will be living in?
    >
    I don't know exactly who said it, but it's a truism that there's no problem
    in computing that can't be solved by adding an extra layer.

    Create a new assembly and within it define a UserGlobals class to hold the
    globals you need. Give it a static factory method to return the globals for
    a particular user. The business object should use that method only to get at
    the globals, and the only thing that's different is the way you
    create/initialize these instances. You can check HttpContext.Current to see
    if you're running in the context of a website (you can reference System.Web
    from any .NET assembly, it doesn't need to be a website project). If so,
    retrieve settings from the session, if not, get them some other way.

    --
    J.

      My System SpecsSystem Spec

  3. #3


    Adrian Guest

    Re: Global vars in different build scenarios.

    Aha ok thanks Jeroen

    "Jeroen Mostert" <jmostert@xxxxxx> wrote in message
    news:48ecf63d$0$189$e4fe514c@xxxxxx

    > Adrian wrote:

    >> We have a solution where one project contains a set of business rules.
    >> We use the rules in a web application and they're integrated into the
    >> main web project. Any global varaibles for the user are stored on the
    >> web session, and that all works fine.
    >>
    >> Now the fun part, we now have to be able to call these business rules
    >> from an old powerbuilder app, where a web server isn't available, so have
    >> to use a com interface layer to call the business rules. The problem is
    >> that we need the com class to initialise some variables and make them
    >> available to the rules class. I know there's not a session object, but
    >> how do you go about coding for the two very different scenarios that the
    >> business object will be living in?
    >>
    > I don't know exactly who said it, but it's a truism that there's no
    > problem in computing that can't be solved by adding an extra layer.
    >
    > Create a new assembly and within it define a UserGlobals class to hold the
    > globals you need. Give it a static factory method to return the globals
    > for a particular user. The business object should use that method only to
    > get at the globals, and the only thing that's different is the way you
    > create/initialize these instances. You can check HttpContext.Current to
    > see if you're running in the context of a website (you can reference
    > System.Web from any .NET assembly, it doesn't need to be a website
    > project). If so, retrieve settings from the session, if not, get them some
    > other way.
    >
    > --
    > J.


      My System SpecsSystem Spec

Global vars in different build scenarios.

Similar Threads
Thread Forum
Preventing Operation Aborted Scenarios
More...
Vista News
By trying to setup System Vars for JAVA in vista I deleted the
System Vars By trying to setup System Vars for JAVA in vista I deleted the PATH CLASSPATH JAVA_HOME well when deleted are recreated to...
Software
Set ENV vars prior to external exe - Override NotifyBeginApplicati
I want to do some housekeeping before executing any/all external console applications (setting some environment vars). In my web research, it...
PowerShell
Live case scenarios on ACT
I am looking for some real case scenarios / case studies / challenging task information carried out using the: UACCE IECE WVCE If anyone...
Vista General
powergadget administrator scenarios
I began to love powergadget ... can any of the forum members share what type of scenarios i can apply for *SIMPLE server administrators* only ? ...
PowerShell
Global Telecommunications Providers to Build Innovative Business IP Phones on Microsoft’s Unified Communications Platform
Global Telecommunications Providers to Build Innovative Business IP Phones on Microsoft’s Unified Communications Platform Innovative phones and PC...
Vista News
Will winfs be used instead of database (in some certain scenarios)?
Hi, I just installed WinFS beta and took a quick look at those samples. Since I have been developing .NET smart client application for a...
WinFS