N-Tier Question

G

Guest

Hello

I am getting a little lost in the N-Tier business. Let me explain what I
have so far.

I am using the Data Access Application Block to execute my SQL stored
procedures on the backend. I have several DLL classes that call the DAAB and
receive datasets on return. These datasets are then passed back to calling
BLL classes and then onto the Presentation layer which is ASP.NET.

Where I am confused is in which layer should I carry out actions such as
merging the changes of a GetChanges dataset into the orignal dataset before
passing it back to the presentation layer. I currently have actions like this
in the BLL but i'm not entirely sure its the best place or correct place for
it to be.

Any help or guidance towards best practices would be greatly received.

Thanks

R
 
R

Richard Myers

Typically you would want to do such things as close to the source of the event that causes
GetChanges to deduced. Most likely this will be in the BL. Alot of these kinds of questions come
down to the specific project in question and personal perference. To me the purpose of the DAL is
too do nothing more than "talk" to the datastore. If you are Get[ting]Changes then you must have
done something that you think may have changed the data in the dataset, therefore you must have
stored the original dataset somewhere so that you could implement the merge. Whereever this occurs
is where you should probably be handling this process.

Something else that might help you decide is in thinking about nTier as not only a separation of
layers for specific functions (presentation/BL/dal) but also what that allows you to do and the
ramifications of where you put the type of code you described. If you were to swap your asp.net
front end for a winforms implementation and your presumably SQL Server backend for an Oracle
backend, how much of this type of code would you have to rewrite?

If it is alot then chances are your putting too much in either end and you should think about
refactoring to the middle tier. If the GetChanges you made require some BI to determine what goes
where and what constitutes a change then it should be in the BL. If it is merely some mundane
translation of some kind then it might well be a DAL function.

hth
Richard
 

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