Escaping DLL Hell
-
Upload
joao-braganca -
Category
Internet
-
view
254 -
download
0
Transcript of Escaping DLL Hell
Escaping DLL Hell
João Bragança//github.com/thefringeninja//the.fringe.ninja/blog@thefringeninja
eVision SoftwareSafety Software for Oil & GasDen Haag, Netherlands//evision-software.com
Computing circa 1992●Premium PC
o486 DX2o16 MB Ramo$3-$5k
Computing circa 1992●Premium PC
o486 DX2o16 MB Ramo$3-$5k
●Windows 3.1
Computing circa 1992●Premium PC
o486 DX2o16 MB Ramo$3-$5k
●Windows 3.1●Extremely Limited by Today’s Standards
Computing circa 1992●Premium PC
o486 DX2o16 MB Ramo$3-$5k
●Windows 3.1●Extremely Limited by Today’s Standards●Shared Memory
2001 - .NET Framework 1.0●AppDomain
2001 - .NET Framework 1.0●AppDomain●Global Assembly Cache
Problems●Pain of Manually Loading Assemblies
Problems●Pain of Manually Loading Assemblies●Must use Child AppDomain + Marshalling
Problems●Pain of Manually Loading Assemblies●Must use Child AppDomain + Marshalling●Strong Naming
Escaping DLL GAC Hell
2010 - .Net Package Managers●OpenWrap
2010 - .Net Package Managers●OpenWrap●NuPack
2010 - .Net Package Managers●OpenWrap●NuPack●NuGet
Problems●Assembly Binding Redirect - Never Works
Right
Problems●Assembly Binding Redirect - Never Works
Right●Requires SemVer be Followed - It Isn’t
Problems●Assembly Binding Redirect - Never Works
Right●Requires SemVer be Followed - It Isn’t●Strong Naming (again)
Escaping DLL GAC Nuget Hell
Escaping DLL GAC Nuget Hell
SHARED DEPENDENCIES
Solution
(Some) Upfront Design
Solution
Service Oriented Architecture
Service Oriented Architecture●CORBA
Service Oriented Architecture●CORBA●DCOM
Service Oriented Architecture●CORBA●DCOM●Web Services (WCF)
Service Oriented Architecture●CORBA●DCOM●Web Services (WCF)●Micro Services
Service Oriented Architecture●CORBA●DCOM●Web Services (WCF)●Micro Services●Nano Services
Service Oriented Architecture●CORBA●DCOM●Web Services (WCF)●Micro Services●Nano Services●Femto Services
Service Oriented Architecture●CORBA●DCOM●Web Services (WCF)●Micro Services●Nano Services●Femto Services
Service Oriented Architecture●CORBA●DCOM●Web Services (WCF)●Micro Services●Nano Services●Femto Services
Service Oriented ArchitectureJust Services.
Service Oriented Architecture●[A Service is] a logical representation of a
repeatable business activity that has a specified outcome
Service Oriented Architecture●[A Service is] a logical representation of a
repeatable business activity that has a specified outcome
●Is self-contained
Service Oriented Architecture●[A Service is] a logical representation of a
repeatable business activity that has a specified outcome
●Is self-contained●May be composed of other services
Service Oriented Architecture●[A Service is] a logical representation of a
repeatable business activity that has a specified outcome
●Is self-contained●May be composed of other services●Is a “black box” to consumers of the service
Service Oriented Architecture●[A Service is] a logical representation of a
repeatable business activity that has a specified outcome
●Is self-contained●May be composed of other services●Is a “black box” to consumers of the service●These are just fancy words for “a function.”
Service Oriented Architecturepublic delegate Task<decimal> GetAccountBalance(string accountNumber)
Service Oriented Architecture●Use these functions for inter-component
communication
Service Oriented Architecture●Use these functions for inter-component
communication●Keep boundaries crisp
Onion Architecture
Solution
Onion Architecture
Onion Architecture●Center Takes No Dependencies
Onion Architecture●Center Takes No Dependencies●Ports and Adapters
Onion Architecture●Center Takes No Dependencies●Ports and Adapters●Dependencies Point Inwards
Onion Architecture●Center Takes No Dependencies●Ports and Adapters●Dependencies Point Inwards●Keep Implementations on the Outside
oDatabaseoHttp
OWIN
Solution
OWIN●The only dependency is on mscorlib.
OWINAppFunc:
Func<IDictionary<string, object>, Task>
MidFunc:Func<AppFunc, AppFunc>
OWIN●The only dependency is on mscorlib●Reduces Δ between production and
development
OWIN●The only dependency is on mscorlib.●Reduces Δ between production and
development●Fast integration tests - possible to test entire
pipeline in memory
ILMerge / ILRepack
Solution
ILMerge / ILRepack●Merges multiple assemblies into one
ILMerge / ILRepack●Merges multiple assemblies into one●Internalization
ILMerge / ILRepack●Merges multiple assemblies into one●Internalization●Virtually eliminates shared dependency
problem
Source Packages
Solution
Source Packages●SimpleJson
Source Packages●SimpleJson●LibLog
Source Packages●SimpleJson●LibLog●netfx-Guard
Putting it Together
Solution
Putting it Together
Sales
Putting it Together
Sales Ware-house
Putting it Together
Sales Ware-house
GetInventoryCountFunc<string, Task<int>>
IsItemAvailableFunc<string, int, Task<bool>>
Putting it Together
Sales Ware-house
GetInventoryCountFunc<string, string,
Task<int>>
IsItemAvailableFunc<string, int, Task<bool>>
Questions?
Resources●//github.com/gluck/il-repack●//owin.org●//github.com/damianh/LimitsMiddleware●//github.com/damianh/LibLog
João Bragança//github.com/thefringeninja//the.fringe.ninja/blog@thefringeninja