Why can't MetaLogicFactory be overriden?

I was investigating the feasibility of overriding the default “An error has occurred.” page to have my own. I saw in the EWL source that it looks like the use of AppMetaLogicFactory is written as a provider that can be overridden. I found where EWL obtains an instance of AppMetaLogicFactory and I found:

GlobalType = GetType().BaseType;
                MetaLogicFactory =
                    GlobalType.Assembly.CreateInstance( “RedStapler.StandardLibrary.EnterpriseWebFramework.” + GlobalType.Namespace + “.MetaLogicFactory” ) as
                    AppMetaLogicFactory;

So all of this functionality of defining the app’s error page, intermediate login page, file not found page, etc are all abstracted, but then obtaining a reference of the implementing class is hard-coded.

1 Like

Yeah, the stuff is abstracted because we couldn’t obtain the PageInfo objects from within the Standard Library project; they are generated into ISU.cs in the Web Site project and the dependency between those two projects goes the wrong way.

If we want to let people customize the error pages, it might be better to just give them WebControl-returning properties in a provider. That way they can customize the content of their error pages, but they can’t shoot themselves in the foot by specifying their own error pages that don’t send the right HTTP codes, don’t allow access by anonymous users, etc.

Actually I want the ability to shoot myself in the foot because of that project I’m working on where it’s a problem that I can’t handle errors myself. I noticed that I probably want parts of EWL’s application error handler (such as rolling back the database) and all I really want to do is send the client a redirect code. I was hoping I could use this as a EWL-sanctioned way of doing what I want.