Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@APC is correct, logic should live where it's most appropriate - and: </p> <ul> <li>The UI should still go through the BL layer to get to data, so that your application is consistently structured.</li> <li>If your going to have logic in different locations in the app (in order to meet certain requirements, like performance) you should clearly document what those governing factors are, and it should be easy for the developers that follow to work out. </li> </ul> <p>Two options come to mind (regarding structure):</p> <ul> <li>One way to ensure the application is appropriately structured and clear is to isolate specific "heavy lifting" tasks by interface. Ideally all your data access should already be abstracted out by interfaces anyway, and these should be broken up into logical areas (see <a href="http://en.wikipedia.org/wiki/Interface_segregation_principle" rel="nofollow noreferrer">Interface Segregation Principle</a> - ISP). So you could have a dedicated interface for specific data access needs: [BL] -> [IDataAccess] -> [Concrete Data Access]</li> <li>Another approach (but along a similar vein): instead of having the BL access these special data calls like a regular data access, include or inject it as BL. </li> </ul> <p>How you do the second approach: Define an interface (in the BL layer) that will be used by other business objects: [BL Object] -> [ISpecialBusinessLogic] -> [Concrete Implementation]. The concrete business logic could be anything - but in your case it'll be a call to a special Data Access method / component where you do the "heavy-lifting".</p> <p>When you implement you data access, you have the option of doing it all in a single class / component (that implements multiple interfaces) or separate classes / components that each implement a single interface.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload