It depends on what the method does; it it doesn't store any intermdiate data
in the Payment class, there's no difference. However, if it does manipulate
any data in the class, i.e. not saved to a persistent storage such as a file
or a database, then you migth have a problem, in that the class is shared
between multiple callers, and not just the copy you have when you create an
instance of the class. There's more to it than that, but that shoudl give
you an idea.
--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities -
http://community.integratedsolutions.dk
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
Thanks. One question though. Whats the difference on having
PaymentHelper.ProcessPayment()
instead of
Dim test as new PaymentHelper
test.ProcessPayment()
Thanks
"CT" wrote:
You need to make the ProcessPayment method a Shared function in order to
access without creating an instance of the PaymentHelp class. Check out
the
Shared keyword in the MSDN docs.
--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com... > Hi,
> I am trying to follow the same structure as the MS Application Blocks
> for
> my
> local stuff. I am trying to create an application block to process
> payments
> which I'll hand out to other developers in my company. I created the
> project
> Company.Application.Payment and in that project I created one class
> called
> PaymentHelper.vb after compling I created a new project (win form) and
> then
> reference the Company.Application.Payment.dll I then Imports
> Company.Application.Payment. The problem is If I create a new sub and
> then
> try
>
> Private Sub CallComp()
>
> PaymentHelper.ProcessPayment()
>
> End Sub
>
> it doesn't work. I have to do the foll
>
> Private Sub CallComp()
>
> Dim test as new PaymentHelper
>
> test.ProcessPayment()
>
> End Sub
>
> Why?