Why doesn't EPiServer.DataFactory implement IPageStore anymore??

by Johan Driessen 5. February 2009 14:48

We recently upgraded our project to EPiServer 5 R2, and that made some strange things happen. I had a class that uses the EPiServer.DataFactory to manipulate pages, and in order to make it testable, I had the following constructors:

private IPageStore _pageStore

public NovaImporter() : this( EPiServer.DataFactory.Instance )
{
}

public NovaImporter( IPageStore pageStore )
{
     _pageStore = pageStore;
}

This worked just fine before we upgraded. But now it turns out, in R2 DataFactory doesn't implement IPageStore anymore. In fact, the only interface it implements is IPageSource, which is pretty worthless in this context. Of course, DataFactory still have the same methods, so it could implement IPageStore, it just... doesn't. And to make things worse,  DataFactory is sealed, so you can't really mock it at all, and it only implements PageStoreBase (which only contains event handlers), and the aforementioned IPageSource. So basically, EPiServer just made it impossible to write unit test for anything using the DataFactory. Thanks.

Why, oh why did EP decide to change this? Anyone know?

Tags:

Development

blog comments powered by Disqus

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 2.5 Sweden License.


Welcome to the Dropit blog!

Here we, the people that work at Dropit, will write about stuff that interests us. For example web development, especially with .NET and EPiServer - but we'll also talk about other techniques that interest us, marketing on the web, social phenomenons, pop culture, games and software development in general.