0

I've done a lot of research and before I get into this new project I wan to ask you for opinon of arhitecture I should take.

I am creating an application that is build with multiple modules that are not connected and I want to sperate them as modules. They will be developed separately. Now I want to find a best way to create this in ZF. First idea was to just change path to zf library to external resource and put every project seperate but then session and variables that needs to be common are seprate wich isnt good. What I want is single authentication point (like sign-in on google) and then have this modules (like gmail, calendar, google search etc.).

Next idea is to build subdomains and based on them do some routing: api.example.com -> api module, account.example.com -> another module etc. I found this here: Zend Framework 2 Routing subdomains to module or here Adding sub domain based routes in Zend framework .If this is the right way wich is better?

Another idea is to switch settings in bootstrap. So if request comes from api subdomain set APLICATION_PATH to api/ else to something else. But I dont think I could use same session then.

Third is to create rest auth service and then use the second way to achive this.

Any suggestions or ideas how could I achive this?

Community
  • 1
  • 1
gorgi93
  • 2,457
  • 8
  • 30
  • 53

1 Answers1

-1

Sei ying there is no special move that is best, it all depends, any move could be best, its up to you when the times right, to move correctly, accurately and with great speed...

To sum it up: you have to choose which methods are best for your use case.

Developing separate Modules doesn't mean they won't share the same session once put into one application. There are already dozen of Authentication Modules out there that are able to connect to authenticate against google, too.

If you develop said modules: "Login", "Calendar", "Gmail" and then you put them all into your "MySuperApplication"-Application, then those will share the same browser-session. You'd however make sure that each of those has the proper interfaces to talk to each other.

It's really difficult to answer your question as it appears that you do not really understand the basics of how ZF2 works, therefore my only suggestion can be to start developing and come up with real questions ;)

Sam
  • 16,435
  • 6
  • 55
  • 89
  • you dont understand my question. I dont want to be modules connected. I want for every module to be independent application that means independent bootstrap router etc... – gorgi93 Nov 07 '13 at 17:30
  • 1
    Your Modules shouldn't be a separate "Application" on their own. A application is - most likely - "a website". And on this website you have several separate modules. Those Modules all have their independent configuration. Modules are NO Application. They rely on the infrastructure of the app itself and communicate through the app with each other. - further note, just because i didn't understand you doesn't mean u need to downvote ;) your question really isn't clear (and still isn't even going by your comment) – Sam Nov 07 '13 at 17:41
  • Why they shouldn't be? they have nothing in common beside user database. I want to create some kind of SOA and try to find best way of user authentication and authorization, but I want to share session between zend applications. – gorgi93 Nov 10 '13 at 14:56
  • 1
    @gGololicic No offense but you do not understand what i am saying. Try to read yourself through the documentation and try to understand at best what a "Module" actually is. Stuff like authentication can be easily shared in between Modules. Across Applications you'd be talking about a single-sign-on and even that is possible if you know how single-sign-on works, but that's way too much to cover on SO... – Sam Nov 10 '13 at 15:11
  • Maybe is module wrong word for what Im trying to achive. Will do some more research on zend modules. Im not verry experienced in ZF2. – gorgi93 Nov 10 '13 at 15:23