needing help - constructor overloading

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default needing help - constructor overloading

    Hello everybody,
    I'm developing a XML web service in VB, and I'd like to overload the
    constructor to customize the service:

    [...]
    Private _tblParameters As datatable

    'the default constructor
    Public Sub New()
    MyBase.New()
    InitializeComponent()
    End Sub

    'the overloaded constructor
    Public Sub New(parTable as datatable)
    Me.New()
    _tblParameters = parTable
    End Sub
    [...]

    The project compiles correctly and I can add the web reference in the
    test application. But when I create an object from the service class,
    the overloaded constructor is not accepted.
    Any clue? Thanks a lot.

    alberto.decaro@gmail.com Guest

  2. Similar Questions and Discussions

    1. Needing Flash 7
      I am installing a program which requires Flash 7.0. I can't seem to find it on the website here. Can anyone help me?
    2. needing help with shockwave 10
      :confused; I have been trying to get this program working for about 3 days now. I have tried the link from the game site, and the standalone...
    3. newbie needing help
      Guys, I've been learning for two weeks now, so bear with me :-) I'd like to know how to echo a formatted table using the results from three...
    4. Calling SUPER::constructor in the constructor
      Is it possible to call the constructor that a function inherits from its parent? I tried calling SUPER:: and SUPER-> in a constructor and got...
    5. Needing Help with a webpage
      Hi Some action should be done by user (such as button click) then only we know whether use has read it or not Ravikanth 2000
  3. #2

    Default Re: needing help - constructor overloading

    Constructors are an aspect of object oriented programming environments. Web
    services are not about objects. The fact that there's an object to host the
    web service message handling should not taint your view of them -- it's just
    an implementation detail. Web Services are about XML messages passed to an
    endpoint that is going to do something with the message and perhaps hand
    you a message back. Once you adjust your thinking to that model, then you'll
    be in a better design position.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > Hello everybody,
    > I'm developing a XML web service in VB, and I'd like to overload the
    > constructor to customize the service:
    > [...]
    > Private _tblParameters As datatable
    > 'the default constructor
    > Public Sub New()
    > MyBase.New()
    > InitializeComponent()
    > End Sub
    > 'the overloaded constructor
    > Public Sub New(parTable as datatable)
    > Me.New()
    > _tblParameters = parTable
    > End Sub
    > [...]
    >
    > The project compiles correctly and I can add the web reference in the
    > test application. But when I create an object from the service class,
    > the overloaded constructor is not accepted.
    > Any clue? Thanks a lot.


    Brock Allen Guest

  4. #3

    Default Re: needing help - constructor overloading

    Thanks for your reply.
    So the only way to set the service is to pass parameter to any
    webmethod the service expose? :-(
    Something like this:

    [...]
    Private Sub InitService(parTable as datatable)
    'initialize private members
    End Sub

    <webMethod()> Public Function AnyMethod(parDs as dataset) as String
    'initializing the service
    InitService(parDs.tables("parameters"))

    'webmethod implementation
    '...

    End Function
    [...]

    Still OO thinking!!

    alberto.decaro@gmail.com Guest

  5. #4

    Default Re: needing help - constructor overloading

    So the idea of service oriented is that each invocation of an operation is
    independant from another -- so no objects :) So if each invocation is independant,
    then you'll have to pass whatever data for the operation to do its job.

    Now, if you do want OO semantics, you should consider .NET Remoting. This
    is a way to get distributed OO semantics.

    Web Services is about distributed systems that interop with any technology
    platform. .NET remoting is about distributed .NET to .NET communication.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > Thanks for your reply.
    > So the only way to set the service is to pass parameter to any
    > webmethod the service expose? :-(
    > Something like this:
    > [...]
    > Private Sub InitService(parTable as datatable)
    > 'initialize private members
    > End Sub
    > <webMethod()> Public Function AnyMethod(parDs as dataset) as String
    > 'initializing the service
    > InitService(parDs.tables("parameters"))
    > 'webmethod implementation
    > '...
    > End Function
    > [...]
    > Still OO thinking!!
    >


    Brock Allen Guest

  6. #5

    Default Re: needing help - constructor overloading

    Yes maybe in a better design position to think about Web Services. But this
    is a major setback in terms of application and systems design. Web Services
    take us back to functional programming days and for me that is pre 1981!

    Do we really have to start from scratch with a textual definition of a
    remote procedure call?

    Dave
    Smalltalker

    "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
    news:889664632542633502736704@msnews.microsoft.com ...
    > Constructors are an aspect of object oriented programming environments.
    > Web services are not about objects. The fact that there's an object to
    > host the web service message handling should not taint your view of
    > them -- it's just an implementation detail. Web Services are about XML
    > messages passed to an endpoint that is going to do something with the
    > message and perhaps hand you a message back. Once you adjust your thinking
    > to that model, then you'll be in a better design position.
    >
    > -Brock
    > DevelopMentor
    > [url]http://staff.develop.com/ballen[/url]
    >
    >
    >
    >> Hello everybody,
    >> I'm developing a XML web service in VB, and I'd like to overload the
    >> constructor to customize the service:
    >> [...]
    >> Private _tblParameters As datatable
    >> 'the default constructor
    >> Public Sub New()
    >> MyBase.New()
    >> InitializeComponent()
    >> End Sub
    >> 'the overloaded constructor
    >> Public Sub New(parTable as datatable)
    >> Me.New()
    >> _tblParameters = parTable
    >> End Sub
    >> [...]
    >>
    >> The project compiles correctly and I can add the web reference in the
    >> test application. But when I create an object from the service class,
    >> the overloaded constructor is not accepted.
    >> Any clue? Thanks a lot.
    >
    >
    >

    Dave Anderson Guest

  7. #6

    Default Re: needing help - constructor overloading

    > Do we really have to start from scratch with a textual definition of a
    > remote procedure call?
    :)

    Well, think of it this way -- Web Services are about interop. This interop
    is done with XML, SOAP, XSD, WSDL and a bunch of other specs... but these
    I listed are the basic ones. So, those specs give us the ability to express
    the coupling point for the applications. Thus, that's the contract. So what
    we can do in web services is limited by what those specs allow us to do.
    There is not always a one-to-one mapping from those specs to an OO programming
    environment, like .NET.

    Now, you don't have to work at the WSDL level (though some people think you
    do to get it 100% correct, and there's *some* virtue to that), but as long
    as you understand the underlying fundamentals, then you'll know what you
    can and can't do in your toolkit (VS.NET WebServices). The toolkit hides
    many of these realities and lets you do bad things. That's good that it hides
    the details since that XML stuff can be hard and time consuming, but it's
    bad that it lets you do bad/incorrect things.

    So go ahead and use the toolkit, but don't forget that at the end of the
    day what you're expressing with your toolkit must be legal and interoperable
    with other programming environments (Java, Perl, whatever running on Mac,
    Linux, whatever). The big no-no is thinking in terms of objects and passing
    back .NET-specific types that have no meaning in other programming environments
    (these two points are related).

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]




    Brock Allen Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139