Site Architecture Situation

S

Stanley

Hello all,
I have a bit of a dilema with building a site in VB.NET. Well it really
isn't with VB but instead with my architecture. When building my site I
have all of the controls and such in the ASPX pages which all inherit
from my BasePage class. This allows for my entire site to have the same
layout and I need only to add different controls for each page and not
worry about the layout. That part is not a problem and I believe my
solution works really well.

My problem lies more with the idea of getting data, updating data and
such. I have a data access layer that takes in things like SProc names
and parameters to do all the actual work. I also have my custom
collections that implement IList so that I can work with my collections
as specific objects.

But where do I put the code to make my collections and my DAL to talk
to each other? Should I create a seperate BLL set of classes? Should I
change my DAL to work specifically for this app? Or should the code be
in my custom classes? This has always bothered me as to where it really
should be. I have tried multiple version and never seem to come up with
a concrete answer.

I am not sure my site really needs something as full blown as Rocky
Lhotka(http://www.lhotka.net/ArticleIndex.aspx?area=CSLA .NET) has
come up with but should I do it that way anyway?

I am open to any ideas and any examples would be great. Not really
looking for source code just the pros and cons to each type of
situation. Thanks.

-Stanley

BasePage.vb
|
|
Default.aspx
|
|
Default.aspx.vb
|
|
[whatevercollection].vb
|
|
??????????? BLL?
|
|
dal.vb
 
S

Stanley

Ok I have been doing some thinking aloud to my wife who just sits there
with this blank look on her face and some reading and hopefully I have
come up with something that comes close to what I should be working with.

Presentation Layer
==================
default.aspx.vb - Page Load calls the BLL function GetManufacturers
expecting a custom object of Manufacturers (which is a custom collection
implementing IList)

Business Logic Layer(BLL)
=========================
Manufacturer_BLL.vb - runs the GetManufacturer function to instantiate a
new Manufacturers collection object then send the call to the Data
Access Layer RunProc function which returns a datareader object for the
GetManufacturer function to loop through and create new Manufacturer
objects (also part of the same page as the Manufacturers collection) and
then add them to the newly created Manufacturers collection object. Now
we return the newly created Manufactures collection object back the
presentation layer for use in the Datagrid on the default.aspx page.

Data Access Layer (DAL)
=======================
dal.vb - RunProc queries the SQL database for the data and returns it to
the GetManufacturer function as a datareader.


Now lets say the user is able to add a new Manufacturer to the database.

Presentation Layer
==================
default.aspx.vb - Page submits the text from the textboxes to the
AddManufacturer function and gets back a new Manufacturers collection
object to repopulate the datagrid.

Business Logic Layer(BLL)
=========================
Manufacturer_BLL.vb - runs the AddManufacturer function (should the
presentation layer know how to send it as just text or as a Manufacturer
object?) The data is then passed via a call to RunProc passing in the
parameters and recieves back a datareader with the new data to build
into a new Manufacturers collection object to pass back up to the
Presentation Layer.

Data Access Layer (DAL)
=======================
dal.vb - RunProc sends the data to the SQL SProc to add the new
Manufacturer and then queries the SQL database for the data and returns
it to the AddManufacturer function as a datareader.


When I update, delete or add new entries should I pass the information
back to the BLL to create a new Manufacturers collection object or just
add, delete and/or update the original collection object? By passing the
data back and forth from the database I eat up more traffic and time. By
just updating the original object I save the bandwidth and time but I
eat up memory don't I? Also what is a good way to update the information
without having to loop through all of the data in an object and compare
ALL of the data to see if any of it has changed? Should I add and
property to every collection called IsDirty? Then on every update I can
just loop through and look for that property?

Does any of this make sense? Or am I just more confused than ever?

-Stanley
Hello all,
I have a bit of a dilema with building a site in VB.NET. Well it
really isn't with VB but instead with my architecture. When building my
site I have all of the controls and such in the ASPX pages which all
inherit from my BasePage class. This allows for my entire site to have
the same layout and I need only to add different controls for each page
and not worry about the layout. That part is not a problem and I believe
my solution works really well.

My problem lies more with the idea of getting data, updating data
and such. I have a data access layer that takes in things like SProc
names and parameters to do all the actual work. I also have my custom
collections that implement IList so that I can work with my collections
as specific objects.

But where do I put the code to make my collections and my DAL to
talk to each other? Should I create a seperate BLL set of classes?
Should I change my DAL to work specifically for this app? Or should the
code be in my custom classes? This has always bothered me as to where it
really should be. I have tried multiple version and never seem to come
up with a concrete answer.

I am not sure my site really needs something as full blown as Rocky
Lhotka(http://www.lhotka.net/ArticleIndex.aspx?area=CSLA .NET) has
come up with but should I do it that way anyway?

I am open to any ideas and any examples would be great. Not really
looking for source code just the pros and cons to each type of
situation. Thanks.

-Stanley

BasePage.vb
|
|
Default.aspx
|
|
Default.aspx.vb
|
|
[whatevercollection].vb
|
|
??????????? BLL?
|
|
dal.vb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top