Number of files growing

oscar's Avatar

oscar

27 Mar, 2010 07:16 PM via web

Hi,

I've been using RobotLegs for some weeks now, and I'm really happy with it. It makes development simple and adds flexibility. No doubt about it!

99% percent of my projects involve some kind of backend communication. Today I create a very simple application with 3 views, the main application view and two popups. I used PHP as backend.
This small application has:
10 commands
3 mediators
3 views
3 models
15 events
5 custom classes.

What I would like to get is some feedback is about the number of files for a good-size application. I understand the separation of all actors in the framework, but want to know how manageable is a big application with RobotLegs (thousands of files?).

Thanks for the hard work.

  1. 2 Posted by Stray on 27 Mar, 2010 08:16 PM

    Stray's Avatar

    Hi Oscar,

    it's an interesting question. I have random moments of panic about the number of classes appearing in my app too!

    My current app (which is pretty big) is about 350 classes (across several modules and including interfaces) and 1100 tests. Robotlegs is still going strong... and I personally think that the separation of responsibilities into many files is a good thing provided the files are named so obviously that you can't possibly not know which one to look in.

    For me, it's not just the abstract goal that each class has a clear responsibility. The impact is very concrete: by having highly divided responsibilities, it's easier to have most of your files 'closed'.

    You know what those closed classes need to do, they have fulfilled their unit tests and integration tests, and you probably never need to open that class again. So - while I know some people talk very sensibly about 'less code' being a useful goal, I tend to think more in terms of 'less open code' being the goal. Hence why I favour commands over controllers. A command can be written quite quickly and closed. A controller is constantly being reopened and added to. That always runs the risk that you break something that was previously working.

    If you're worried about the explosion of events then you might find that you can refactor some to AS3 signals (without having to create a new signal class). Particularly view->mediator communications.

    I hope that's helpful - it's just my opinion - other people might have a different view. It partly depends on your style / circumstances. I run a team and manage other projects as well, so I'm constantly interrupted and the RL way suits that by allowing me to eat my application in very small bites!

    Stray

  2. 3 Posted by oscar on 27 Mar, 2010 11:59 PM

    oscar's Avatar

    Thanks Stray! this helps.

Comments are currently closed for this discussion. You can start a new one.