0

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?

gnat
20.5k29 gold badges117 silver badges308 bronze badges
asked Aug 20, 2013 at 16:25
2
  • Model-View-ViewModel (MVVM) works well for single page applications. KnockoutJS makes this fairly simple knockoutjs.com/documentation/introduction.html Commented 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? Commented Aug 21, 2013 at 9:22

1 Answer 1

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.

answered Aug 21, 2013 at 1:28
3
  • 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 emulate Commented 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. Commented Aug 21, 2013 at 6:40
  • OK thanks James. I was looking to split model and data access for sure. Thanks for you time! Commented Aug 21, 2013 at 16:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.