So I'm using Node and ExtJS server-side/client-side respectfully. By using ExtJS, I'm moving a lot of the presentation logic client-side. Thus, something like MVC wouldn't make sense server-side since the view-logic is all client-side.
At this point, my Node server's responsibilities are essentially:
- Act as proxy to persistent storage (MongoDB) for ExtJS stores
- User validation/sessioning with Windows Active Directory
- Hooking-in with existing Enterprise infrastructure (databases, Salesforce.com, etc).
Well I know design patterns aren't the end-all-be-all, and conforming to a design pattern can in some cases impede progress, but I'm relatively new to web-programming in general. I'd like to use a pattern to start just so I don't make any major architectural decisions that will haunt me for the rest of the project.
Is there a pattern will suited for my needs that I could lean-on?
-
Model-View-ViewModel (MVVM) works well for single page applications. KnockoutJS makes this fairly simple knockoutjs.com/documentation/introduction.htmlCodeART– CodeART2013年08月21日 07:20:24 +00:00Commented Aug 21, 2013 at 7:20
-
2@CodeWorks Providing just a link is fine in comments, but answers must meet certain guidelines and criteria to be considered acceptable. For more information see Why and how are some answers deleted?maple_shaft– maple_shaft ♦2013年08月21日 09:22:47 +00:00Commented Aug 21, 2013 at 9:22
1 Answer 1
Not sure what the pattern should really be called, "AJAXing" perhaps.
What you are (should be?) doing is shipping the "model" to the client, then implementing the Controller in JavaScript on the client to produce a view in the browser.
So it is essentially still MVC.
But this oversimplifies the pattern as you are unlikely to be shipping the entire database to the client so you still need to implement a data access/model building layer on the server, control however should still reside in the JavaScript client.
-
Ya that's more or less whats going on. The problem(?) is that since there is so little going on server-side, I can't find a pattern to emulateColin Martell– Colin Martell2013年08月21日 06:36:54 +00:00Commented Aug 21, 2013 at 6:36
-
@ColinMartell -- just think of the server side as a pure data access layer. -- this split between model and data access is quite common in the J2EE world (where complexity++ was invented) so you have database -> data access class -> data model -> controler -> view. Often with each component running on a separate server.James Anderson– James Anderson2013年08月21日 06:40:21 +00:00Commented Aug 21, 2013 at 6:40
-
OK thanks James. I was looking to split model and data access for sure. Thanks for you time!Colin Martell– Colin Martell2013年08月21日 16:31:48 +00:00Commented Aug 21, 2013 at 16:31