Jump to content

  • Log In with Google      Sign In   
  • Create Account


Having a hard time adding abstract classes to my 3-tier website


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Alpha_ProgDes   Crossbones+   -  Reputation: 4688

Like
0Likes
Like

Posted 02 February 2012 - 02:31 PM

I'm only using asp.net, ado.net in .net 3.5. No webservices, asmx, wcf, or anything of the sort.

I'm going to give quick details now, and put more detail later. Just to avoid tl;dr.

Now I currently have a pretty good setup, (IMO). I have my Presentation Layer as my aspx and aspx.vb, my Business Layer as BL.vb, and my Data Access Layer as DAL.vb. And as it should be a method from the PL calls a method from the BL which in turn calls a method from the DAL. However, I would like to have my BL and DAL, both, have a base class (ie. abstract/base class for each) and still keep the 3-tier model. What is the best way to go about doing this?





Now, more detail.

I have webforms that are form-based and does some calculations. Ex. A form which gathers information about widgets, its construction, and its delivery. Now each widget has its own webform (that's a requirement). But the widgets-forms all have common functionality (ex: input weight of widget, calculate velocity of widget cylinders, input number of parts of failures during test, etc). So of course all the widget-forms are going to have base methods for calculations, validation, and data access. So the PLs will differ from another but the validations, data access will be mostly same across them all. Hopefully I haven't lost anyone.

I was thinking of having the BL inherits from an abstract base class and the DAL inherit from a abstract base class. Then having the BL call the DAL as usual. But I think that if the BL inherits from an abstract base class then my DAL goes away (ie. the abstract BL will call the abstract DAL). Am I thinking about this.... near correctly?

If this is a confused mess, my apologies.
Beginner in Game Development? Read here.
 
Super Mario Bros clone tutorial written in XNA 4.0 [MonoGame, ANX, and MonoXNA] by Scott Haley
 
If you have found any of the posts helpful, please show your appreciation by clicking the up arrow on those posts Posted Image
 
Spoiler

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6858

Like
0Likes
Like

Posted 06 February 2012 - 12:31 AM

When using a multi-tier architecture I would take a careful look at the tasks of a single layer and be careful about a clean interface definition. From what I understand (btw. I'm living in the java world, not .net Posted Image ), I would buildup your layers like this:


PLForms
   |
   | access
   |
BLInterface
   |
   | realized by
   |		
   |		  inherits
BLImpl ----------------------> BLAbstractBase
				   |
	-------------------------------------  access
	|
DALInterface
	|
	| realized by
	|
	|		  inherits
DALImpl -------------------> DALAbstractBase
This seems ok to me, I only would add interfaces to atleast the BL and DAL layer.

#3 Telastyn   Crossbones+   -  Reputation: 3726

Like
1Likes
Like

Posted 06 February 2012 - 12:55 PM

However, I would like to have my BL and DAL, both, have a base class


That defeats the purpose of keeping them seperate.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS