Uncle Bob
by charmis
HTML
<html>
<body>
<div>
Uncle Bob talk about Architecture
-----------------------------------
Want Business Rules immune to changes to GUI.
Busuiness Rules should not have knowledge about the existence of GUI.
To achieve that let GUI be connected to Business Rules as a plugin.
Business Rules are completely independent of GUI.
Two dlls - GUI.dll, BU.dll
eg: Resharper is a plugin of Visual Studio.
All source code dependency is in the direction from Resharper to Visual Studio.
All source code dependency should be in the direction from GUI to Business Rules.
Source Code Dependency: Every using written in GUI, would be importing something in Business Rules
There should not be any source file in Business Rules that importing anything from GUI.
Business Rules should also be immune to changes in DB.
GUI -> Business Rules
DB -> Business Rules
DB is not Data Model.
DB is technology that stores data in Disc.
Data layer(Data component) should have some piece of code that translate the technology (tables, fields, relationships etc) to Datamodel and pass to Business rules.
Relational tables are data model.
Datamodel is something we can hold in memory.
ORM - oxymoron-
ORM should sit inside Data layer.
Source code dependency = Resharper -> Visual Studio
Flow of Control = Visual Studio -> Resharper (VS gains control from OS, then pass the control to Resharper)
How can Visual Studio calls the functions in Resharper but still do not know those functions exist?
Inversion of Control = We implement interface.
Through polymorphism we cross that boundary.
----
Source Code dependencies flow toward high level
Low level components depend on high level components
Resharper is low level detail. VS is high level policy
Flow of control can go in either direction.(low level to high level and vic versa)
------------------------
Every device driver in Unix have 5 magic functions - open, close, read, write, seek
Polymorphism is implemented in C in Unix using...