Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Project Directory structure  (Read 9564 times)
ghess
Courseware Beta
Jr. Member
***
Posts: 12


View Profile Email
« on: February 06, 2008, 11:23:30 »

Hi All,

Getting ready to start my first project and am looking for guidance on the project directory structure.

Should the main source folder just be the root project dir?

Should this main source folder contain an assets, css, com, org ect.. or should I separate swf, css and image resources from the code?

From the training I like the package structure com.comp.app.model/view/controller.

Any examples are much appreciated.

Thanks,

Greg


Logged
Rhysyngsun
Courseware Beta
Sr. Member
***
Posts: 51

Nathan Levesque

 - rhysyngsun@gmail.com  - rhysyngsun
View Profile WWW Email
« Reply #1 on: February 07, 2008, 12:56:35 »

I have been placing my assets withing the subdirectory of whatever components/code uses them. This has two benefits: cleaner code and if I ever decide to reuse the code, I only have one directory to copy. Although I would say that for a style for the entire application, you may wish to place this at the root instead of having it scattered about. It depends a lot on the relationship between your skins and your code.

If you have an application that is split up into multiple parts then I usually split it up into sub folders (i.e. com.puremvc.app.forum.view, etc. ). This way packages contain only code relevant to that particular piece of functionality.



A little digression; the package structure isn't usually named after the company/organization but rather the reverse domain name of your website:

Ex..: www.puremvc.org -> org.puremvc.....

The reasoning behind this is that only one individual/organization is associated with a domain name, this helps avoid package naming conflicts.

Of course, this mostly matters if you plan on reusing your code elsewhere/distributing it or are bringing in libraries that having naming conflicts with yours.

Here's a document on Adobe's site explaining it in more detail (it's for AS2, but most of it carries over, package details are near the bottom):
http://www.adobe.com/devnet/flash/articles/as_bestpractices_02.html
Logged

ghess
Courseware Beta
Jr. Member
***
Posts: 12


View Profile Email
« Reply #2 on: February 07, 2008, 02:55:40 »

Thanks for your comments!

I didn't consider placing assets with the components, interesting strategy and see your point. Past projects I have worked on in java, I made great efforts to place style, layout and graphical assets away from the java classes and always avoided at all costs placing code in the jsp's. This was because I often had a graphics/web designer working on the same project and to avoid code corruption allowed them to work isolated from the actual logic. Graphics and web designers are familiar with xml markup, style sheets and graphics, but not the code and allowing them to perform their work without the confusion of negotiating with the code was very benefitial to both sides of the team. The project I am working on does have a graphics/web designer and for the reasons mentioned I may not employ this strategy. For these reasons I am also feeling a bit uncomfortable placing 'views' folders inside the source tree, however the close relationship with the mediators is convinsing me otherwise. However, being a new team, new employer new language/sdk I am not sure if the graphics/web designers will be comfortable editing view components directly. I am going to try and I guess will train them on only editing 'components' and assets folders. Have you had success with this in your projects?

My application is split up into multiple parts and will follow the strategy you referenced.

I also think it might be wise to create a separate main source in the project root folder 'src' to house the project source to avoid polution (metadata folders, build output, libs and htmltemplate).

Much appreciated!

Greg
Logged
Pages: [1]
Print