Replies: 9 comments 12 replies
-
I really don't know about Media R architecture : ) and the very little I have read about VSA, I don't think Csla would be a good fit. |
Beta Was this translation helpful? Give feedback.
-
Timely https://jeremydmiller.com/2024/02/12/the-case-against-clean-architecture/ |
Beta Was this translation helpful? Give feedback.
-
I'm not an expert on Clean Architecture. I tend to steer clear of Uncle Bob due to factors outside the realm of technology, and that might be part of why I've never spent a lot of time learning about it. My understanding though, at a high level, is that it is an onion model, with layers wrapping other layers. I've never characterized the CSLA architecture (the "A" originally stood for Architecture) with that sort of visual, instead presenting it more like a layer cake (yummy!).
Either way though, it seems like the idea of well defined layers is key, as is separation of concerns, and the hard part: keeping concerns from leaking across layer boundaries. The really hard part, with MIcrosoft tech since 1991 anyway, has been keeping business logic out of the interface/interface control layers (out of the UI). It is so damned easy to just put validation and other logic in the UI - and some UI frameworks have encouraged it directly (XAML for example). The result is that (to this day) most apps are built with tons of logic in lost focus events, button click events, in controller postback methods, and other places where business logic absolutely must not exist. It seems to me that Clean Architecture, like CSLA, is based around the idea that violating this rule (like almost everyone does) is why it is effectively impossible for apps to survive a UI tech change. Nearly every enterprise out there is stuck maintaining Windows Forms and Web Forms apps, because the business logic is hopelessly interwined with the UI layers (and sometimes even the data access is intertwined - though obsoleting the DataSet helped!). Yeah, see, now y'all have me ranting 😁 |
Beta Was this translation helpful? Give feedback.
-
With regard to MediatR, I've used the library/package as a way to manage some messaging but didn't realize there was an entire application architecture behind it. I look forward to learning what people think about using it for more than a loosely coupled messaging tool. |
Beta Was this translation helpful? Give feedback.
-
Also, since I was ranting anyway, I did a mastodon thread: https://elk.zone/fosstodon.org/@rockylhotka/111925831104217117 |
Beta Was this translation helpful? Give feedback.
-
Thank you for pointing this out, I am guilty of making the same 'mistake' : )
It also reminds me of the time when I first started working with CSLA, I couldn't figure out a way to implement Inheritance in Csla and by that I mean base classes (abstract and concrete) with derived classes having its own 'Data Portal' methods. |
Beta Was this translation helpful? Give feedback.
-
I keep thinking about how a solution might have BOTH a WebAPI and a rich interactive LOB app. For the LOB app, I would want direct access to the richness of CSLA business objects. But for the WebAPI I will be feeding DTO/POCOs to N number of unknown client UIs/processes. So MediatR "could" be used for both behaviors:
Number 2 is pretty straightforward so I won't talk about that much (other than to say organizing into vertical slices makes it so that you don't care whether you've coupled your app with CSLA objects because pages are isolated in slices). Your LOB cuts out the middle man (JSON and DTOs). I think the LOB app could use MediatR to abstract away the details of fetching biz objects but I'm not sure it helps there since you'd be coupled anyway. I keep thinking parts of MediatR might compete with CSLA features but I don't know till I try it out to see if there is overlap and whether it is useful or not. Don't want to use a technology just because it's sitting there. Number 1 is more interesting. The WebAPI would use MediatR to pass along requests (for the meaty stuff). It would not know that the MediatR Handler is using the same CSLA biz objects as LOB app to get the job done. The CSLA biz objects would be made to know how to validate/consume/produce data from/to DTOs....like hydrating themselves from DTOs and validating their state prior to continuing on. |
Beta Was this translation helpful? Give feedback.
-
😁 A new term I keep hearing "modular monolith" I'm not sure why but that makes me chuckle. |
Beta Was this translation helpful? Give feedback.
-
Another take on the overall topic. https://thenewstack.io/composable-architectures-vs-microservices-which-is-best/ |
Beta Was this translation helpful? Give feedback.
-
I've used CSLA since 2004 right up to current day in small to enterprise code. Recently CSLA made good on it's original promise once again by easily allowing us to make a major UI change from .NET Framework WebForms to .Net 6 Blazor. Once we got over the BL having to change to accommodate DI in CSLA 6, the rest was easy and exclusively involved changing the UI layer.
Lately I've been learning more about "Clean Architecture", "MediatR" and "Vertical Slice Architecture". I'm honestly a bit turned off by CA, but very intrigued by MediatR and VSA. Given the CSLA 8 e-book series coming out, I wonder about either a section there, or a couple blog articles, or even better a few video interviews where you compare these big-picture architecture styles and talk about IF and/or WHERE CSLA might or might not be used in those styles versus traditional N-Tier layered architecture.
For instance:
In summary it would be cool to hear if you see CSLA as applicable only to NTier layered architecture or if it solves problems in other styles as well.
Beta Was this translation helpful? Give feedback.
All reactions