Shared or Instance Method?

W

Water Cooler v2

I'm a web newbie so be gentle.

Should I make this static/shared and put it in Glabal.asax or should I
make it an instance method? Since it does not have constant parameters,
is it thread-safe to make it a static/shared method, given that this is
a web application?


Public Function GetFullName(ByVal FirstName As String, ByVal LastName
As String) As String

If FirstName.Trim = vbNullString Then Return LastName.Trim
Return FirstName.Trim & IIf(LastName.Trim = vbNullString,
vbNullString, Space(1) & LastName.Trim)

End Function
 
P

Peter Rilling

I would say, do whatever is convenient for your code. In this case is
really does not matter.

Sorry if you wanted something more specific, but sometimes there is no right
answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
topweb3twitterchannels

Latest Threads

Top