Question

I'm a programming teacher. My students learn structured and then object oriented programming in JavaScript and C#. They learn SQL, MS SQL Server, Dapper and EntityFramework Core.

After this they make applications with data access code directly in the ASP.NET Core WebAPI controllers. I tell them not to do that, and teach them about layering, the old n-layer architecture, and the onion architecture reversing the dependencies. We work with testability and unit tests. And they learn to not expose objects of the domain model outside the application.

Let's assume that a full understanding of Domain Driven Design and CQRS are out of scope for my students, and/or assume that they will make some small and simple applications.

What architectural topics could I consider teaching them in this context? Another way of asking the same would be; in a simple application based on good object-oriented programming, ASP.NET Core WebAPI and SQL Server Db - and a Vue.js frontend, what would be a simple but still good architecture to consider?

No correct solution

OTHER TIPS

The most fundamental architectural question is:

What knows about what?

Look at any uml diagram and you’ll see lines going from box to box. The arrow heads tell you what knows about what and what doesn’t.

Isolating knowledge is the goal of every architectural principle you’ve mentioned. So yes more advanced techniques may be out of the scope of your classroom but simple abstraction is a darn good start. The value of good names that keep those who read your code from needing to repeatedly peek inside to remember what this does.

Keeping the CPU happy is one thing but good architectures keep the humans happy too. Good names and good abstractions keep me from wishing you’d just do it all in one file.

So how to teach that? Make them program to one spec. Then make them deal with a surprise change. Let them see the cost of not isolating knowledge. And make them read each other’s code.

You don’t have to prescribe an architecture here. Just give them a problem that shows the value of one.

Licensed under: CC-BY-SA with attribution
scroll top