Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the controller loading and wrote the book chapter about it
- Loading branch information
Boris
committed
Feb 4, 2013
1 parent
4346cf0
commit 623b07c
Showing
5 changed files
with
76 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<p>Double-click to edit a todo</p> | ||
<p>Created by <a href="https://github.com/BorisKozo/myTodoMvc">Boris Kozorovitzky</a></p> | ||
<p>A project for the HP JS cookbook by Boris Kozorovitzky and Elad Moshe</p> | ||
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> |
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Boris, I am still reading your book and trying to integrate your architecture here into my own app in order to learn your architectural philosophy.
I am influenced by the writings of Addy Osmani over here http://addyosmani.com/largescalejavascript/#mediatorpattern
I have bought two of his books Developing Backbone.js applications and Javascript patterns.
I am enamored by the mediator pattern, modules pattern and facade pattern he described in his largescalejavascript article.
I discovered his AuraJS is still facing a rewrite while I need something I can use right now, I searched for a long time till I found your book here, which is excellent.
After the past couple of days, I have come to realize that you are using controller in each mini app as a mediator within the mini-app. Correct me if I am wrong about this.
My question is:
do you then have an overall mediator for the various mini-apps to publish and subscribe events?
I have read your book.md several times and I have checked the history of this file. I cannot find an answer to this question. Please enlighten me.
Thank you!
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thank you for your positive feedback on our book.
You are right, the controller is the mediator within the mini-app.
And you are right that there should be a mediator between the mini-apps.
I believe you should use the App object as the mediator (or create another object and assign it to the App) instantiate this.
As you can see the App object has no dependencies. This is an intentional design decision to allow it to become a mediator between mini-apps in the future.
We know about AuraJS but we didn't use it for this small project to keep things simple.
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
We are not planning to do any changes to this project or the book. It was sort of "funded" by HP but now canceled.
If you want to, you can submit a pull request and I will review it.
Thanks,
Boris.
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Addy is one of the pillars of the community and I think everyone knows him (he might know me from one of the pull requests, probably not).
You can talk with him directly via twitter @addyosmani , I am sure he will answer.
Also Derick (the creator of MarionetteJs) is one of the most awesome developers I know. He will surly answer you on twitter @derickbailey .
As I mentioned in one of my previous comments, you can get live assistance with anything you need via IRC (freenode) chat. The relevant rooms are #documentcloud for backbone and #marionette for Marionette.js
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey guys. I just wanted to chime in to say that I'm happy to respond to any questions as time allows. It's usually easier over twitter these days but I'm humbled there's been continued interest in large-scale JS patterns. Both Marionette and Aura build upon concepts like the mediator pattern and I'm sure Derick would similarly be up for responding to questions depending on availability.
623b07c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addyosmani - Oops, I forgot you would get a notification on that mention. :)