Should I try to put asp control events into the BLL?

If the event has to do with the business model, then you should create a method in the BLL. If it's a UI type of event, handle it in the code behind. So, for example, if the user clicks a button to calculate the shipping, in the button's click event handler (code behind) call your BLL object's CalculateShipping() method.

If, however, you have a button that changes the background color of the page (I couldn't think of a better example) then you would handle that completely in the code behind.

Given this architecture: Presentation -> Business -> Data Any layer should only know about and make assumptions about the layer to its immediate right. This means that the presentation layer can talk to the business layer and use it's API but it should never talk directly to the data layer. The business layer can use the data layer's API but it should never know about or make assumptions about the presentation layer that consumes it.

And obviously the data layer should know nothing about any of the other layers. If you follow this general principal you will find that your application will be simpler and easier to maintain. To answer your question though, button click events belong in the presentation layer - putting a button click event into your business logic would blur the lines between the two layers and would create unnecessary coupling.

Your ASPX code behind file (Presentation Layer) could either have a direct reference to your BLL (results in coupling) or you can use a more service oriented approach. This would involve creating interfaces referenced by your Presentation Layer and implemented by your Business Layer. During application initialization (i.e.In your Global.

Asax file), you can you connect the BLL to your Presentation Layer via dependency injection or some other approach.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions