PDA

View Full Version : Is custom App Structure like this possible?



vitalyx
31 Jul 2012, 2:59 AM
Hello,

We are building a system that will be used by many clients. Each client has a set of services that they want to make available on mobile devices. For example, some clients may offer service1 and service2, others - service2 and service3. Our job is to create components that represent those services and that will be used to create an app that matches the set of services particular client provides.

Presently, we adhere to the standard convention and our app structure looks like this:



app
model
service1
service2
...
view
service1
service2
...
controller
service1
service2
...
store
service1
service2
...
profile
phone
tablet


What I think might be beneficial for our particular project is to have application structured like this:



app
service1
model
view
controller
store
service2
model
view
controller
store
...
model
view
controller
store
profile
phone
tablet


What do you think about that? Is this possible? Are there any potential cons?

Thanks,
Vitaly

jerome76
31 Jul 2012, 5:08 AM
I structured my app project like the second way you suggested. It is a lot easier to manage which services go to which client when you install the application.

vitalyx
31 Jul 2012, 9:37 AM
Thanks for your reply, Jerome. I'm wondering if you had any issues from not using the standard convention for the project structure? Also, how well did it work for the common parts shared between multiple services and where were those defined?

jerome76
31 Jul 2012, 10:05 AM
All my components are defined separately. Say you have the structure


app
service1
model
view
controller
store
service2
model
view
controller
store
...
model
view
controller
store
profile
phone
tablet

JS files from service 2 could use other content from other JS files in service1 (the same works for any directory in the project) as long as those components or content is created/loaded respectively.

So if you define your components in their respective folders, and then dynamically load them using Ext.create(), you can use those components throughout your code.

If I had common parts, such as a global function or something, I would write those parts in a JS in a 'main' folderinside the 'app' directory itself.

I haven't run into any issues using this structure. I don't think the structure matters. As long as your components get loaded into memory accordingly, there shouldn't be issues.

ashokvilvanathan
7 Aug 2012, 3:21 AM
Hi,

In these case, can we able to build a package that only contains service1?

Same way, another package that contains only service2.

Is there any way of do it?

Thanks in advance.

jerome76
7 Aug 2012, 4:31 AM
You would have to remove the other services from the project directory.