473,473 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Shared (Static) Class in VB.net

I'm new to .Net and all it entails :-

I'm trying to design a solution that has a group of business rule objects (per session) to do validation on rows from a datagrid. I want to have "static" classes so the web app can just call the class methods to validate the data...using the builtin validators doesn't seem to be a good solution due to the fact that the business rules will be complex and require all the logic to be centrally located

Any tips on how to accomplish this

I started by defining an IBusinessRule interface and want to create a class for each rule using the interface..

Thanks
-Will
Nov 18 '05 #1
2 1974
If the implementation is different, the interface is a good thing. If the
implementation is the same, use an abstract class instead, so you do not
have to write the same code over and over.

Static methods are great for helper type functions. I would not use them to
kludge up a class.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** *************
Think outside the box!
************************************************** *************
"will" <an*******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
I'm new to .Net and all it entails :-)

I'm trying to design a solution that has a group of business rule objects (per session) to do validation on rows from a datagrid. I want to have
"static" classes so the web app can just call the class methods to validate
the data...using the builtin validators doesn't seem to be a good solution
due to the fact that the business rules will be complex and require all the
logic to be centrally located.
Any tips on how to accomplish this?

I started by defining an IBusinessRule interface and want to create a class for each rule using the interface...
Thanks,
-Will

Nov 18 '05 #2
If the implementation is different, the interface is a good thing. If the
implementation is the same, use an abstract class instead, so you do not
have to write the same code over and over.

Static methods are great for helper type functions. I would not use them to
kludge up a class.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** *************
Think outside the box!
************************************************** *************
"will" <an*******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
I'm new to .Net and all it entails :-)

I'm trying to design a solution that has a group of business rule objects (per session) to do validation on rows from a datagrid. I want to have
"static" classes so the web app can just call the class methods to validate
the data...using the builtin validators doesn't seem to be a good solution
due to the fact that the business rules will be complex and require all the
logic to be centrally located.
Any tips on how to accomplish this?

I started by defining an IBusinessRule interface and want to create a class for each rule using the interface...
Thanks,
-Will

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul Wu | last post by:
From what I understand, in ASP.NET, each HTTP requests is serviced by a separate thread. So if my code uses a static Class with shared members and properties, I can manage concurrent access by using...
7
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. What are the implications, (in terms of memory, application footprint, resource use, threading, and so forth), of using Shared methods? These Shared classes raise...
11
by: dee | last post by:
OleDbCommand class like many .NET classes has the following description in its help file: "Thread Safety Any public static (Shared in Visual Basic) members of this type are safe for...
15
by: Rob Nicholson | last post by:
A consequence of the ASP.NET architecture on IIS has just hit home with a big thud. It's to do with shared variables. Consider a module like this: Public Module Functions Public GlobalName As...
1
by: Brian Henry | last post by:
When you say shared in vb what does it exactly mean... the other languages use static in the same place of this in .NET here is an example Public Shared Event Idle As EventHandler Shared =...
7
by: Iain Mcleod | last post by:
Hi This must be an often encountered problem. I want to declare an abstract class or an interface with nothing but several static constants so that I can use polymorphism when I call each of them...
11
by: Mr Newbie | last post by:
I'm still thinking around this subject, and I find myself unsure about a couple of things. When a new users launches an ASP.NET application, this must be on a new thread. When it encounters a...
5
by: Simon | last post by:
Hi all, We have an ASP.NET 1.1 application running on IIS6 on Server 2003. Most of the base objects we are using in this application are taken from a windows application also written by us. We...
0
by: TamusJRoyce | last post by:
Thought of solution, but any thoughts would be welcome... I am curious about how I could know the type of an object I am working with from a base class. It would be nice if VB .Net supported...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.