A lot has changed since the original architecture has been defined.
During implementation the core steadily shifted from host side to target side.
As a result, some existing code became overdesigned or is now just in the wrong
place.
The system is now quite close to being somehow functional for native targets,
therefore it might be a good time to revise the existing architecture.
A revised architecture would ensure that in the future the virtualization
engine can be easily expanded and that new features can be added without
unnecessary efforts.
At least the following areas need attention:
- Redefine Core project.
Core contains a mix of code, targeted at either the host or server side, or at
both sides.
Perhaps the current Server project should be part of the new Core, while the
current Core should be split up into the existing and/or new projects.
- Revise database access methods.
Is there still a point in only allowing the host to access the database? Doing
this causes (unnecessary?) expensive transfers of data between host and target,
while the host side doesn't really do anything with the data read and sent. One
of the original reasons for using this system was to avoid conflicts between
the virtualization engine and its own database access.
- Revise database access API.
Currently a generic command based system is used.
During development of the virtualization engines, database access has become
significantly less complex (e.g. the filesystem engine doesn't use any database
anymore). Therefore it should be investigated if the current system is
overdesigned for its current goals, and/or for its future goals.
- Revise purpose of Watcher.
Can the Watcher be merged with the Host? Needing two processes to support a
single target process is simply not justifiable.
The original purpose of Watcher was to ensure having a simple/stable process
which would always ensure a clean GAC, in case the Host would leak some garbage
there.
It should be investigated if, as an alternative, it would be save to let the
watcher run in a separate application domain in the host process.
- Revise lifetime of Host.
Is it necessary to leave the host running once the target process is set up?
Note that this conflicts with the previous statement, since combining both
statements would result in leaving target process' running on their own.
Is this safe? How will a clean system be ensured?