coherence icon indicating copy to clipboard operation
coherence copied to clipboard

Decoupling controller functionality

Open sashman opened this issue 6 years ago • 1 comments

Hey,

I'm very interested in coherence and the functionality it provides, however, I'd like to experiment with combining its functionality with other frameworks, for example ueberauth, or just in the case where I would like to use my customer controllers.

I have noticed that a lot of the meat is inside the coherence controllers, for example in order to fully create a new session you require to use Coherence.SessionController.create/2. Would it be a good idea to separate this functionality into a separate module so it could be used outside of coherence?

If this seems sensible I could start with a PR to pull out session functionality? I'm not 100% sure what the *_service.ex modules are intended for, but this would be a place I'd refactor the functionality to.

How does this sound?

sashman avatar Jan 17 '18 15:01 sashman

I know I'm late on responding to this. I would be interested in a discussion around what you see.

I'm not a fan of the Service abstraction I was using for a while. Perhaps something else though.

You may want to do a quick proof of concept on 1 controller for something to discuss.

There is a change I would like to make to the generated controllers. Instead of a complete copy of the Coherence controllers, I would like to have them use a module that injects the actions with def overrides. This way, updating coherence may be a lot easier...

Perhaps there may be a good marriage of these two ideas.

smpallen99 avatar Aug 27 '18 21:08 smpallen99