Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Base Processor - exposing Umbraco context services #200

Closed
leekelleher opened this issue Jan 6, 2017 · 5 comments
Closed

Base Processor - exposing Umbraco context services #200

leekelleher opened this issue Jan 6, 2017 · 5 comments
Assignees
Labels
enhancement rfc Request for Comment
Milestone

Comments

@leekelleher
Copy link
Collaborator

leekelleher commented Jan 6, 2017

From reading Umbraco core's recent Common Pitfalls & Anti-Patterns document, should we consider exposing the Umbraco objects via our DittoProcessorAttribute? (rather than letting developers use the static singletons)

Of course, under the hood we'd actually be exposing the static singletons, (since this is how Umbraco core do it - e.g. SurfaceControllerFactory.cs; not using dependency injection), this would encourage developers to use our exposed properties, so in future we could potentially replace/inject them (or however Umbraco core team recommend we package devs should do this).

Based on the doc, (and the Umbraco core's PluginController code), we could expose the following properties...

  • ApplicationContext
  • UmbracoContext exposed as Umbraco
  • DatabaseContext
  • ServiceContext exposed as Services
  • MembershipHelper exposed as Members
  • ProfilingLogger / Logger

re: UmbracoHelper - we shouldn't need to expose this, as it is typically used to retrieve from the content/media cache, whereas we can use UmbracoContext.ContentCache.GetById directly.


Any thoughts?

@mattbrailsford
Copy link
Collaborator

mattbrailsford commented Jan 6, 2017 via email

@JimBobSquarePants
Copy link

Yup. Definitely wise.

@jamiepollock
Copy link

Late to the party, but this would be awesome. :)

@mattbrailsford
Copy link
Collaborator

Shall we close this and move the discussion to the PR?

@leekelleher
Copy link
Collaborator Author

Onwards to #204

Let's go!

@leekelleher leekelleher added this to the 0.11.0 milestone May 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement rfc Request for Comment
Development

No branches or pull requests

4 participants