Code Foresting

Sebastian Gebski

Code Foresting

Automating Architecture Governance

What to
expect?

#architecture
#dotnet​ #fsharp
#continuousinspection
#ndepend #typeproviders
#automation #powershell
#roslyn #livingdocumentation

Who am I?

Sebastian Gębski

 

I lead software-based products' delivery.

#lean #dddesign #dotnet #elixirlang
#architecture #webdev

@liveweird

https://no-kill-switch.ghost.io

Once upon
a time ...

Architecture

Governance Fallacies

"Architecture
  is a belief system."

Ralph Loura (CIO of Clorox)

Why is it so
difficult?

 

 

* forget or DGAF
* "siege mentality"
* misaligned goals
* deadline pressure
* personal ambitions (ego)
​* different past experience

Rashomon
Effect

  • subjective VS objective

  • opinions VS facts

  • ​what is good enough?

Hell is

paved with

assumptions

"I've explained

it to you ...t

already."

 

"It will be faster

when I do it myself.

Over the weekend."

Laws of
Architecture Governance

Communication

>>>

Anything Else

1 Sergeant == 3 Generals

Share the
Ownership

Secure the
perimeter

Shared vision
& principles

"Dowieraiaj, no prowieriaj"

Feliks Dzierzynski

Two key strategies

* validate afterwards
* constrain up-front

Code Foresting

The Ideas Behind

Architecture

Code

Docs

Identify
deviations

Fast Feedback

Sanitize them

Swarm with robots

Pillars of Code Foresting

1.  Secure the Perimeter

2.  Communication

3.  Expressive Code

4.  Convention Testing

5.  Living Documentation

Continuous
Inspection

1/5. Secure the Perimeter

* Re-use as much as possible
* Long compilation time
* Avoid code duplication

Concepts & Solutions

* Reference "Spike Model"
* Old | New separation
* Tools to manage dependencies
* Decommission over the time

Cake

* composable
* doesn't kill "VS DX"
* integrates with all IDEs
* scriptable in C#
* modular (plenty of add-ins, supporting tools)

2/5. Communication

Priorities &

concepts (1/2)

* leadership "in the trenches"
* "healthy" Knowledge Base
* examples, examples, examples
* x-team communication ("guilds")

Priorities & concepts (2/2)

* values & principles!
* transparency (LADRs & syncs)
* information radiators (Pub-Sub)

3/5. Expressive
Code

* metadata​​ (annotations, attributes)
* conventions​ (marker interfaces)
* DSLs (meta-programming)

4/5.
Convention
Testing

Priorities
& Concepts

naming conventions *
coupling, dependencies *
component isolation *
boundaries respected *

NDepend

proprietary tool (licenses!) *
.NET-focused *
produces report + artifacts *
provides flexible CQL(inq) *
limited capabilities in terms of metadata *

full compiler SDK *
very low-level *
analyzers & mutators *

5/5. Living Documentation

Priorities & Concepts

evergreen *
a side-effect of work *
generate from metadata *
generate from code *
tests <-> docs *

DocFx

* .NET-friendly
* documentation generated from API
* MD support (articles)
* static content embedded
* self-hosted or just static bundle

Gluing it all AKA
Continuous Inspection

scripting -> PowerShell *​
data exchange -> Type Providers *​
NDepend/Roslyn -> F# *​
input -> Argu *​

Epilogue

Lessons learned

* tried single-handedly gets 10x harder
* won't replace communication
* technically - not an issue
* introduce gradually
* fast feedback is crucial
 

Sebastian Gębski

@liveweird

https://no-kill-switch.ghost.io

https://slides.com/sebastiangebski/devconf-2018​

Code Foresting - DevConf 2018

By Sebastian Gębski

Code Foresting - DevConf 2018

How to set up, govern & monitor application architecture in large, distributed environment. Examples in .NET, but concepts are general.

  • 732