Let's say I have an application that is 80% complex business logic and 20% CRUD, or vice versa.
In the past I have used some kind of command pattern and had classes like ComplexFooCMD
or EvenMoreComplexBarCMD
but always ended up with a bunch of InsertFoo
, UpdateFoo
, DeleteFoo
and SelectFoosCMD
and a few of UpdateSomeValuesOfFoo
or SelectSomeFoos
. All of these lived in the BLL.
Recently on less complex business logic applications I have used a service pattern with classes like FooService
but these also contain the expected insertFoo
, updateFoo
and selectSomeFoo
. Having these methods on every service or even having services which only exist to expose those methods to the presentation layer feels like a lot of boiler plate code.
Is there any pattern that fits both the CRUD part and the rest of the application, or should I use different patterns for the different parts of the application?