U4-4769 - Remove the circular references from Content, Media & Member services for calls like ToXml which then calls into the PackagingService

Created by Shannon Deminick 28 Apr 2014, 04:55:46 Updated by Shannon Deminick 28 Apr 2014, 09:06:35

For example, in the ContentService we do content.ToXml() which calls into the PackagingService but the PackagingService requires an instance of the ContentService, this is not good practice and means unit testing is much more difficult.


Shannon Deminick 28 Apr 2014, 04:59:57

IMO I think we should change the PackagingService for any method that performs an Import to take an instance of the service it requires to do the import. Then we obsolete the normal ctor for the PackagingService so that it does not depend on any other service. Then we can accept an instance of the PackagingService on the ContentService to perform the XML serialization instead of calling into extension methods which rely on the ApplicationContext singleton.

Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 6.0.0, 6.1.0, 7.0.0, 7.1.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.1.1, 6.0.6, 6.0.5, 6.0.7, 6.1.2, 6.2.0, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.1.1, 7.2.0, 7.1.2

Due in version: 6.2.0, 7.1.2


Story Points: