Best way to structure your robot legs projects
Hi all, Just wanted some best practise advice on how I should structure my robotlegs projects, My project is starting to get bigger and Im wondering about how most people structure their projects.
Im currently seprating everything based on each main view of my
application
eg. My app has 5 views
Login View
Job View
Client View
Vehicle View
Worker View
So my structure is as follows
com.cavej03.appName +
+ Controller
+ login
+ worker
+ client
+ worker
+ vehicle
+ Event
+ login
+ job
+ client
+ worker
+ vehicle
> Model
+ etc...
> Service
+ etc...
> View
+ etc...
Its somewhat tidy but I still think someone who is looking at my
code is gonna freak....
Can anyone recommend common practise, also when i comes to naming commands and events some advice here also..
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
1 Posted by Paul Robertson on 27 Apr, 2013 04:54 AM
I started off structuring my apps that way. However, as my projects got
larger I found that structure to be in need of improvement. My preferred
structure, taken from posts in these forums, is to actually break it down
in the opposite way. I first divide packages by "module" (I.e. by what it
does in the app, such as login, client, worker, etc in your example). Then
within those packages I place my individual views, commands, events,
models, etc., each in their own package.
Paul
2 Posted by Joshua Cave on 27 Apr, 2013 04:57 AM
Currently doing that exact process.... Thanks for the reply.. First time robotlegs user.. Im loving it... such a cool fun way to program.. makes me feel boss!
Support Staff 3 Posted by Ondina D.F. on 27 Apr, 2013 11:24 AM
+1 for Paul’s suggestion
4 Posted by Joshua Cave on 27 Apr, 2013 11:31 AM
where do you put your events
Support Staff 5 Posted by Ondina D.F. on 27 Apr, 2013 01:22 PM
Some people do it like this:
--controller
------commands
------events
--model
------vos
------events
--service
------events
--view
------events
Other people do it so:
--controller
--events
--model
--service
--view
I’m putting the events into a single events folder under controller. I find it to be much more clear and easy to find them.
Note: I prefer the plural form for my folders’ names, but that's just a personal preference, nothing more. I just think it is important to be consistent, using either singular or plural names for all your folders/packages. Some might say that naming your folders model, view, controller (singular) is the way to go, because it would reflect the MVC pattern. Also, there are numerous articles and discussions on the internet(s!) promoting the singular form for package names for various reasons, some of them being very good. But the dispute about singular vs. plural package-names has not ended yet ;)
Ondina
Support Staff 6 Posted by creynders on 16 May, 2013 09:36 AM
I'm closing this for now, if you have any more questions let us know!
creynders closed this discussion on 16 May, 2013 09:36 AM.