473,473 Members | 1,457 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 1973
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.