473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1969
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.