Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To Class or not to Class

Status
Not open for further replies.

GrandMauler

Programmer
May 16, 2007
74
US
Hello.

Some time ago, I wrote a VB.NET/SQL application for a Telecom company that basically looks up call routes and displays the specifics of the given route on the GUI.

For a call routes, there are many specifics to display... mainly the type of tariffs applied to a route. Depending on the location of the route, the company, and the type of route, the routes specifics can vary quite a bit.

All of the information is housed on a database on a production server. The VB.NET GUI simply pulls the data from the db into related ADO.NET datasets.
This allows me to use bound controls and grids... thereby minimizing code.
All of the calls to the back-end are done on the Form Class.

The application works fine.

However, I've been recently toying with the idea of further abstracting the application by developing classes. I wanted to see if I could simplify the app further for ease of maintenance, maybe clean up or further minimize the code in the GUI form class.


As I started designing my classes, it occured to me that I may be complicating something that is as simple as it's gonna get, since all the app does is display information. There is nothing to input to the back end. Basically, I'd be adding another level or tier to the application. I'm not sure what the benefit to this would be.


So am I correct in surmizing that class development is more for applications that are designed for input and computational purposes?

Or should I investigate further?
 
Classes are used in everything. Even the simple version of the app you have is entirely object oriented (meaning it's made up of classes).

What it sounds like you are thinking about is a DAL (Data Abstraction Layer). Creating a DAL from scratch is a rather major undertaking with a good number of design considerations and a fair amount of complexity.

If you are only going to use the data in that one project, and it is a very simple project, and you don't already have a DAL of some sort, I would say just stick to the simplest solution. I do think having a DAL is the BEST option code wise. But it is not the always best option when you consider time, costs, and limitations.

There's no reason to build an interstate highway to Podunk, Missouri. But it is much nicer driving on an interstate than a 15 year old pea gravel road.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Thanks, Rick. By the way, I do realize the Classes are used in everthing. I simply meant designing my own class.

I did occur to me that I may be "re-inventing the wheel"... what with so many available class libraries in .NET ... such as ADO.NET.

As to your "Podunk" analogy, loved it!

You're right, of course. However, the trick is to figure out whether or not "Podunk, Missouri" will one day become a major trucking hub. Sometimes, the signs aren't so obvious.


Thanks for you indepth answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top