I'm not sure that โcomplexโ is the right word; it really depends on what you define as โbusiness logic,โ and ensuring that you keep the separation of problems clean.
Read: GetById, GetByName, GetPaged, GetByFilter ... etc Methods
Like you, I would call it all read, and I think they are fine (GetById in particular). Some of the more obscure that you have are probably fine too if they are data oriented.
RE Caching: I did this mainly in BL, although I see no reason why you could not do this in DAL if that was appropriate . If you have a bunch of clients beating up the data repository, and the data doesn't change too often - then of course, why not.
RE Border: A few things come to mind.
- I always abstract my actual data access provider behind the interface (); if you make sure that this interface is clean of dependencies (that is: it will work equally well for MS SQL, Oracle, MySQL and NoSQL data sources), then you are on the right track - as soon as you imagine something that DAL technology is specific for an interface that, as you know, you are doing something wrong (if you are in the .net generic-ish types, such as DataTables, are great IMHO).
- When you develop BL, you should have some idea of โโthe size of the application and probably the envelope of the bottle; therefore there is no reason why you cannot be smart about how BL (and DAL) is designed. Thus, when you are faced with a business task that, as you know, will be clogged, return a lot of data, etc. I think itโs good to consider developing methods that will solve it in an effective way. You can design an interface with both bulk and a few smaller queries that do the same - so you cover various use cases. Yes, there will be luck related to maintainability, but this is partially mitigated if you take into account some thoughts / design upward (a bit like how you need to fix security in the application - and not try to add it later, as the next one).
Finally ( imporant ) - the thing about BL is that although it is often complex, it is also specific to the application / service you are working on; the data itself can have its own rules, and sometimes they are best applied at the data level - not in individual applications.
source share