How to migrate from bbv.Common
This page explains the changes we made when we renamed the project and cleaned-up its structure.
Event Broker
Renaming of subscription handlers
The built-in subscription handler were renamed because they were confusing:
- Publisher is now OnPublisher
- Background is now OnBackground
- Interface is now OnInterface
- InterfaceAsync is now OnInterfaceAsync
State Machine
Changed syntax to build hierarchies
Old: machine.DefineHierarchyOn(SuperState, InitialLeafState, HistoryType, InitialLeafState, AnotherLeafState, YetAnotherLeafState)
New: machine.DefineHierarchyOn(SuperState).WithHistoryType(HistoryType).WithInitialSubState(InitialLeafState).WithSubState(AnotherLeafState).WithSubState(YetAnotherLeafState)
Changed how multiple actions are defined to allow mixing of actions with and without access to the event argument
Old: machine.In(SomeState).On(SomeEvent).Execute(Action1, Action2)
New: machine.In(SomeState).On(SomeEvent).Execute(Action1).Execute(Action2)
Entry and Exit actions can now have access to the event argument
Now it is possible to access the event argument in entry and exit actions:
machine.In(SomeState).ExecuteOnEntry
ExceptionThrown event was removed
All exceptions are now passed to the event TransitionExceptionThrown
.
Therefore, you only need to listen to a single event now.
Evaluation Engine
Introduced interface IAnswerer to be compliant with Interface Segregation Principle
This new interface allows to inject an evaluation engine with just access to the Answer
methods.
IO
IIOAccessFactory
- Renamed IIOAccessFactory to IAccessFactory
- Changed registering of extensions
- New IDrive and IEnvironment
- Removed 'Access' from every method name and interface name (except IAccessFactory of course)
Logging
All log4net loggers were removed from the binaries and moved to a source code nuget package: Appccelerate.SourceCodeTemplates. This simplifies modifying logging to your needs.
Csv Parser / Writeer
Moved to Appccelerate.IO package.
UserInterfaceThreadSynchronizer
Moved to Appccelerate.Async package.
bbv.Common package
Package was replaced with Appccelerate.Fundamentals package.