What is Clean Architecture in .NET? - .net-core

What is "Clean Architecture" in .NET ? What doesn't qualify as "Clean Architecture" ?
Are CQRS, DDD mandatory for "Clean Architecture" ?
What is onion architecture ?
Please clarify ... I am actually lost with "Clean Architecture".

Since the question is too broad, I try to answer it on a high level.
What is "Clean Architecture" in .NET ?
In short: "The same as in every other language". Architecture is mainly about managing dependencies, because dependencies are the main problem when it comes to code smells like fragility, rigidity and immobility. It is also often called the structure of the system and I can structure .NET application the same way as Java, JavaScript or even C++ applications. The concepts of repositories, use cases (interactors), entities and so on stay the same, even though their implementation differ based on the language features.
What doesn't qualify as "Clean Architecture" ?
I would say each architecture that breaks the main rule of separating the business value from technical details. That's the core of the clean architecture - to make the business rules technology agnostic with the goal to make them easy to test.
So whenever you have a system structure that needs to boot up a complex framework, a web server or a database (that must be initialized with ddl and dml) just to test your business rules, you don't have a clean architecture.
Are CQRS, DDD mandatory for "Clean Architecture" ?
No, these concept usually fit very well with the clean architecture, but they are concepts that the clean architecture does not require. E.g. you can implement your domain logic as an anemic model and still be clean architecture compliant. But I think it would be a better idea to use DDD or at least a kind of rich domain model.
What is onion architecture ?
The onion architecture is an architecture that was introduced by Jeffrey Palermo. He also wants to decouple the business rules from the technology details. Jeffrey Palermo says:
Hexagonal architecture and Onion Architecture share the following premise: Externalize infrastructure and write adapter code so that the infrastructure does not become tightly coupled.
and he says:
The database is not the center. It is external.
Thus the clean archtitecture and the onion architecture have a lot in common. That is not a big suprise, because Robert C. Martin says in his The Clean Architecture blog:
Over the last several years we’ve seen a whole range of ideas regarding the architecture of systems. These include:
Hexagonal Architecture (a.k.a. Ports and Adapters) by Alistair Cockburn and adopted by Steve Freeman, and Nat Pryce in their wonderful book Growing Object Oriented Software
Onion Architecture by Jeffrey Palermo
Screaming Architecture from a blog of mine last year
DCI from James Coplien, and Trygve Reenskaug.
BCE by Ivar Jacobson from his book Object Oriented Software Engineering: A Use-Case Driven Approach
Though these architectures all vary somewhat in their details, they are very similar.
Thus the clean architecture is a consoidation of other architectures that is enhanced with ideas from Robert C. Martin.
I hope my answer helps you to classify the different terms.

Related

SOA modelling terminologies

I am learning SOA for our new project. I want to know basic information on SOA modelling technologies. I saw lot many terminologies in internet like SoaML, BPMN, SOMF, SOMA, SOBA ... and confused when/where to use what modelling technology.
Please help me to identify exact technology to model our services.
Thanks in Advance.
SOAML - UML Profile (Modeling notation) for modeling SOA.
BPMN - Modeling notation for for modeling business processes.
SOMF - Methodology for designing SOA architectures. From Michael Bell. Supported by tools like Sparx Enterprise Architect
SOMA - Methodology for designing SOA architectures. From IBM. Supported by RSA.
Haven't heard of SOBA.
Model your services using the simplest tool you can, I use blocks and line drawings for the overview (service) level models and UML sequence diagrams for depicting internal orchestration.
The modelling language will not help you learn how to build SOA, experience of doing and following best practices will help.
Good luck and enjoy the journey

Rapid Application Development?

I'm studying for an exam on Thursday, and in the notes there is a differentiation between incremental development and prototyping. RAD in the notes is said to be an incremental methodology, but anytime I've studied it previously I've referred to it as more of a prototyping method for development.
I'm just wondering whether other people see it as a prototyping methodology?
It should be possible to use an incremental method even for prototyping. Rapid application development is highly suitable for prototyping. The idea is the a.s.a.p. create something "working" on the screen with less of documentation than other development practices.
There is a wikipedia page about this R.A.D. which states the definition and use.
I found rapid application development suitable for developing smaller projects when you are undecided about several factors, for instance language choice, and the programming language of the final product might be another one than what the prototype used.
BTW, the RAD tag you're posting with here stands for IBM Rational Application Developer which is an integrated development environment whose abbreviation also is RAD.

Where can I find a good high-level overview of Enterprise technology concepts?

Where can I find a good high-level overview of Enterprise technology concepts and how they intermingle?
Such as, what is a:
Service Bus
Application Server
Messages
Middleware
The book Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions by Hohpe and Woolf, along with its supporting web site http://www.eaipatterns.com/ are terrific resources.
In the same series, Patterns of Enterprise Application Architecture by Martin Fowler is also very valuable. Martin Fowler's website contains a great amount of material, here is a good starting place: http://www.martinfowler.com/articles/enterprisePatterns.html.
SOA Design Patterns by Thomas Erl, and the companion web site, http://www.soapatterns.org/, is even more encyclopedic. I particularly like this treatment of the enterprise service bus pattern and its constituent patterns.
As with all books on patterns, once you've read through the introductory material, they can be used a reference books, allowing you to selectively read the topics that are of interest, and perhaps going back later for a more thorough, cover-to-cover reading.

One ERP vs. Quality software applications + service oriented architecture?

As a modern large company, is one ERP system better than hundreds of highly specialized applications which are service oriented? To provide a little bit of background, we are providing consulting for a client who wants to invest their resources in a monolithic ERP system which will manage everything! What are the pro's and con's of this approach?
As an application developer, I tend to believe that specialized well written and managed software packages tied together by a service architecture would out perform a monolithic approach.
What do you think?
As an application developer, I tend to
believe that specialized well written
and managed software packages tied
together by a service architecture
would out perform a monolithic
approach.
Maybe, but getting support for one system from one party is easier than getting support from multiple parties and making sure that integration works and keeps on working.
I think a more important question is whether to pick a general ERP or a custom fitted one. Whether the architecture is service oriented or monolithic is maybe is related, but also general ERP systems can be service oriented.
This almost feels like a traditional question on buy vs. build. I will try to lay out
some importan points.
If you clients has deep pockets only then can they viably maintain the high total
cost of ownership and complexity associated with developing and
maintaining custom-designed applications.
Off-the-shelf ERP solutions integrate the best business practices from a variety of
industries and incorporate these best business practices into your
client's operations which ultimately translates into bottom-line improvements.
Custom-designed applications provide the desired degree of functionality,
but their size and complexity require lengthy design, development, and
implementation efforts.
A good example that I can think of is Microsoft. Microsoft spent 10 months and $25 million installing SAP R/3 to replace a
tangle of 33 financial-tracking systems in 26 subsidiaries. As a result of the
implementation, Microsoft estimates annual savings at $18 million,
leading Bill Gates to call SAP "an incredible success story."
Hope this helps you think more broadly from all angles.

Service Oriented Architecture: How would you define it

Service Oriented Architecture seems to be more and more of a hot quote these days, but after asking around the office I have found that I seem to get many different definitions for it. How would you guys define SOA? What would you consider the official definition?
As Martin Fowler says, it means different things to different people. His article on the topic is pretty good although it isn't quite a definition.
http://martinfowler.com/bliki/ServiceOrientedAmbiguity.html
It may explain, the difficulty coming up with a concrete definition.
Wikipedia: "A SOA is a software architecture that uses loosely coupled software services to support the requirements of business processes and software users. Resources on a network in an SOA enviroment are made available as independent services that can be accessed without knowledge of their underlying platform implementation."
SOA is not that new, but it has potential to achieve some amazing things. But the organization has to be ready for it: the business has to think in processes and that's the big problem
I'd go with:
Defining a series of stateless, client
agnostic business operations created
to be leveraged in multiple
applications.
An SOA design includes components (i.e., services) that can be used by code regardless of implementation (i.e., any OS or langauge). A single instance of a service may also be used by multiple applications, whereas, e.g., a DLL would have to be duplicated for each app and require the same implementation technology as the linking application.
Services in an SOA design are usually implemented as interoperable web services.
There isn't an official definition as Ryan mentioned eariler. However, I find Thomas Erl's view of the whole service-orientation quite well-structured and relevant. Here is the definition of SOA from his SOA Glossary (more):
Service-oriented architecture represents an architectural model that aims to enhance the agility and cost-effectiveness of an enterprise while reducing the overall burden of IT on an organization.
Thomas Erl is the author of many SOA titles most of them receiving endorsement from SOA vendors including IBM, Oracle, and Microsoft. The nice thing about his books is that they are as SOA vendor independent as possible. It means you learn more about service-orientation itself and less about some vendor's middleware that supports SOA.
I agree with all of the people that point you to Fowler on this. Basically it runs like this: service oriented architecture got a reputation as being good, so anything that people want to be associated with good they call SOA. In reality it has a lot of downsides and can create a Service Oriented Gridlock or Dependency Oriented Architecture.
Here's my go at a definition:
Service Oriented Architecture is a systems integration and code reuse approach where applications are dependent on connecting to services provided by other running applications across the network. This is distinct from component architectures, where software components are shared statically between applications in the form of libraries or SDKs, for example.
A clarification here - "Service Oriented Architecture is a systems integration and code reuse approach where applications are dependent on connecting to services provided by other running applications across the network."
I have a scenario where two j2ee applications have been integrated using event driven messaging. Here the above phrases of systems integration and connecting to services provided by other running applications across the network hold good. Can i call this SOA ?
The following principles would hold good here
1) statelessness
2) message oriented - loosely coupled infact de-coupled
3) extensible.
However, the following do not apply
1) platform independence - neither of the applications being integrated has been designed to work in a different platform.
2) The applications are plain j2ee applications which have not been designed with all soa concepts.
I attempted to define SOA in one of my blog posts. Here's an excerpt...
For years it's been standard practice to separate functionality into functions, classes, and modules. The idea has always been that these smaller, highly specialized components are easier to share and maintain than monolithic blocks of code.
Functionally, SOA is not much different. The goals are the same - reusability and easy maintenance. The biggest difference - in the case of a web service SOA - is that the shared library included in your application is replaced with an HTTP call.
Here's a definition for you:
SOA - Software Over Architected. The inclusion of pointless, over-bloated, functional interface framework called an architecture in a pretty web site with a 3d graphic folder flying from one side to the other where "dir /s > a.txt | ftp -s:upload.ftp" did the job.
Software components are not bricks, cannot be generalised by common functional patterns and architecture emerges in the enterprise from good practice, not good design. Software isn't architected, it's engineered.
SCRUM ON!

Resources