Real world project structure with Sencha Architect
I am new to Sencha ExtJS and Architect MVC, but I know MVC and some other JQuery libraries in general.
I want to ask when building a real-world system, what is the proper approach to layout an Sencha app structure in Architect 2?
For example, we have the following departments in our app, they have distinct functionalities:
Accounting, Controlling, Quality Assurance, Customer Services, Human Resources, Logistics, Purchasing, Sales, Records Management ...
Approach 1: Write them in different Sencha Architect projects. Stitch up with master layout page + main area + header/footer + side bar pages. (using MVC.NET in our case)
- Multiple programmers can work on different sub-projects in an agile environment.
- Each project is smaller and easier to be upgraded or replaced.
Approach 2: Write them all in one big Sencha Architect project. So, it sarts up in a single app.html page with everything in it.
- We have different Sencha Architect projects for, e.g. main areas, side bar, header, footer. How do they collaborate with each other? We now only use JQuery to pass information between them, but it feels kind of hacky.
- Now every component in the project can collaborate with each other.
- All-in-One app.html looks nice.
Question is, if we take approach 1 how do we make communications between different projects? If we take approach 2, is Sencha Architech 2 designed to build real-world project that way, stacking everything in one big project?
- Having hard time if multiple programmers are working on one Sencha Architect project.
- It is one big complicated piece of app. Loading speed may be an issue, I am just guessing because we don't know if Sencha Architect MVC design loads relevant parts bit by bit or everything together.
First I'll say that your thinking about this problem in all the right ways. Your pros and cons are spot on.
Second this was originally posted here: http://stackoverflow.com/questions/1...61936#15561936
My suggestion is to have separate projects that are more loosely coupled and perhaps connected by a portal/dashboard application. The glue app can be written in anything including Ext JS in Architect.
I build Architect which is in fact a very large single page application. As a team we all do our best to keep each system able to work with as little dependency on any other system(s) as possible. We use things like eventing, pub/sub, adapter and plugin patterns, etc...
These systems are very much broken into separate namespaces and directories which like all software helps developers compartmentalize. Architect doesn't fully support this idea today. However with convention you can get close. e.g. HRController, HRNewEmployeeForm, HREmployeeGrid
Having HR as a separate app however, affords you HR.EmployeeController, HR.NewEmployeeForm assuming your app name is HR. Each app being a separate project also allows for the dev team to be more agile in how it deploys!! Major win.
Other users have taken this approach and one such user graphs all his projects together using a managed iframe approach http://www.sencha.com/forum/showthread.php?243179
Asp.Net MVC is another good approach and might afford you some features like user auth etc...
Hopefully this helps!
Tags for this Thread