Function Library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Jackson

    Function Library

    In clasic asp you could have some include files that had all your common
    functions in them so you could include them in your application by <!
    Include ing them.


    Ok - Im new to asp.net -
    im wanting to construct a function library in asp.net - but i heard someone
    in the list say that that is the older way of thinking - we are now to think
    in OOP style and classes stuff.

    Help - where on the web can i read about this type of method of including
    classes into my asp.net pages...?

    Thanks.


  • PJ

    #2
    Re: Function Library

    ASP.net pages ARE classes. New webforms are set to inherit from
    System.Web.UI.P age. However you can create your own base page and have your
    asp.net code behind classes inherit from that page. Your base page would
    include common elements(UI)/functions used by the rest of your pages
    (classes). I think you will find that you will not need as many generic
    "helper functions" as you once wrote in an asp application as the .net
    framework is rich w/ it's functionality. You can also create a class w/ a
    private constructor w/ only static methods much the same way you use :
    System.DateTime .Now :

    This is a good guide on architecture for asp.net applications.
    Gain technical skills through documentation and training, earn certifications and connect with the community


    ~PJ

    "Chris Jackson" <someone@micros oft.com> wrote in message
    news:ePaxOdoODH A.3664@tk2msftn gp13.phx.gbl...[color=blue]
    > In clasic asp you could have some include files that had all your common
    > functions in them so you could include them in your application by <!
    > Include ing them.
    >
    >
    > Ok - Im new to asp.net -
    > im wanting to construct a function library in asp.net - but i heard[/color]
    someone[color=blue]
    > in the list say that that is the older way of thinking - we are now to[/color]
    think[color=blue]
    > in OOP style and classes stuff.
    >
    > Help - where on the web can i read about this type of method of including
    > classes into my asp.net pages...?
    >
    > Thanks.
    >
    >[/color]


    Comment

    • Yan-Hong Huang[MSFT]

      #3
      RE: Function Library

      Hello Chris,

      I replied the question in another of your post. Just now I saw PJ's answer.
      I am not sure of whether I misunderstand your questions before.

      I agree with PJ that you could inherit a page to create an own page. The
      points here is that what you want to reuse. If it is a function library,
      such as email sending library, you could use a class library as I
      mentioned. If you want to reuse a page, you could create a base page as PJ
      suggested.

      Please feel free to post if you have any more concerns.

      Best regards,
      yhhuang
      VS.NET, Visual C++
      Microsoft

      This posting is provided "AS IS" with no warranties, and confers no rights.
      Got .Net? http://www.gotdotnet.com
      --------------------
      !From: "Chris Jackson" <someone@micros oft.com>
      !Subject: Function Library
      !Date: Tue, 24 Jun 2003 14:30:44 -0500
      !Lines: 16
      !X-Priority: 3
      !X-MSMail-Priority: Normal
      !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
      !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
      !Message-ID: <ePaxOdoODHA.36 64@tk2msftngp13 .phx.gbl>
      !Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
      !NNTP-Posting-Host: 66.49.58.146.nw .nuvox.net 66.49.58.146
      !Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
      !Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1545 67
      !X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
      !
      !In clasic asp you could have some include files that had all your common
      !functions in them so you could include them in your application by <!
      !Include ing them.
      !
      !
      !Ok - Im new to asp.net -
      !im wanting to construct a function library in asp.net - but i heard someone
      !in the list say that that is the older way of thinking - we are now to
      think
      !in OOP style and classes stuff.
      !
      !Help - where on the web can i read about this type of method of including
      !classes into my asp.net pages...?
      !
      !Thanks.
      !
      !
      !

      Comment

      • Kevin Spencer

        #4
        Re: Function Library

        ASP is procedural in nature. Therefore, you used "function libraries" as you
        describe it for storing commonly-used functions. As you have pointed out,
        ASP.Net is object-oriented. This means that you use classes instead. A class
        is basically a collection of data, functions, and executable code that are
        treated as an atomic unit, with certain characteristics shared by all parts
        of the class. It hides much of its' internal data and exposes only the data
        and functionality that is useful and safe to be accessed. Object-oriented
        programming involves a good bit more than this, however, so your request for
        a source of information is well taken.

        I would recommend downloading the free .Net SDK from Microsoft for more
        information (at least to start with). This is the most excellent software
        documentation I have ever used for any product, and it is not only a
        reference, but has many articles and samples as well. The URL for download
        is:



        HTH,

        Kevin Spencer
        Microsoft FrontPage MVP
        Internet Developer

        Big things are made up of
        lots of Little things.

        "Chris Jackson" <someone@micros oft.com> wrote in message
        news:ePaxOdoODH A.3664@tk2msftn gp13.phx.gbl...[color=blue]
        > In clasic asp you could have some include files that had all your common
        > functions in them so you could include them in your application by <!
        > Include ing them.
        >
        >
        > Ok - Im new to asp.net -
        > im wanting to construct a function library in asp.net - but i heard[/color]
        someone[color=blue]
        > in the list say that that is the older way of thinking - we are now to[/color]
        think[color=blue]
        > in OOP style and classes stuff.
        >
        > Help - where on the web can i read about this type of method of including
        > classes into my asp.net pages...?
        >
        > Thanks.
        >
        >[/color]


        Comment

        Working...