Using TOM.NET from custom code
You should use the .NET Tridion Object Model (TOM.NET) for developing templating, event handling, Workflow and a few extensions; for all other interaction with the Content Manager you should use the Core Service. If you use TOM.NET directly from your custom code, your applications become a host for the Content Manager kernel with detrimental affects.
Apart from templating, event handling and workflow, the following extensions also use TOM.NET:
- all Publisher extensions points (that is, custom Resolvers, Renderers and packagers)
- custom Virtual Folder Types
- binary content providers
Using TOM.NET directly from code has the following detrimental affects:
- Failure to upgrade configurations
- When you upgrade Content Manager, SDL Tridion Sites only upgrades your configuration for expected hosts of the kernel. Your custom code would not be an expected host and so continue to use an old configuration.
- Increased memory usage
- The kernel has a large memory footprint, and your custom code would claim its own footprint, seriously affecting your memory usage.
- Increased number of database connections
- The kernel uses a database connection pool, and your custom code would claim its own database connection pool, opening more connections to the database. This would not only result in overhead on the database server, it could also cause you to reach your licensed limit of database connections.
- Impaired security
- Because your custom code would act as a host, the identity under which it runs would need to have sufficient permissions on all resources that the kernel accesses. This would have serious security implications.