Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ben Liyanage 11 posts 32 karma points
    Jun 04, 2010 @ 17:06
    Ben Liyanage
    0

    Instantiating Application Level Objects

    Hey,

    I find myself building an application that uses around 10 Web References in various controls throughout my umbraco installation.  They way I currently have my application set up is that I have stored the authentication credentials in my web config, and then instantiate the connection to the webservice every time I need to make a query.

    Is there a way I can instantiate these webservice queries at application start, and then reuse them as necessary?  I am partially concerned with performance, and partially concerned with having duplicate code creating these connections all over the place.

    I am running Umbraco 4.0.x on IIS7.

    Thanks,

    -Ben

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jun 04, 2010 @ 17:21
    Ismail Mayat
    0

    Ben,

    See my blogpost on integrating log4net you could use same principle to wire up your webservices.

    Regards

    Ismail

  • Ben Liyanage 11 posts 32 karma points
    Jun 04, 2010 @ 18:11
    Ben Liyanage
    0

    This seems a little invasive, as you have to remove a delivered DLL.  Is there a way to do this without modifying the core application?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jun 05, 2010 @ 04:04
    Aaron Powell
    0

    You're basically wanting dependency injection. I use Autofac (http://code.google.com/p/autofac/) for DI in projects (including Umbraco).

    Google has plenty of good articles which can get you started with DI.

Please Sign in or register to post replies

Write your reply to:

Draft