Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm starting a massive project for the first time. I was supposed to be one of the developers on this big project, and all of a sudden, the lead developer and his team backed out of the contract. Now I'm left managing this big project myself with a few junior developers under me and I'm trying to get a firm grasp on how this code should be broken up.

Logically, to me, the code should be broken up by the screens it has. I know that might not be how it SHOULD be done. so tell me, how SHOULD it be done? The app has about 6 screens total. It connects to a server, which maintains data about all other instances of the app on other phones. You could think of it as semi-social. it will also use the camera feature in certain parts, and it will definitely use geolocation. probably geofencing. It will obviously need an API to connect to the server. most likely more APIs than just the 1. I cant say much more about it without breaking an NDA.

So again, my question pertains to how the code should be broken up to make it as efficient as possible. Personally, i'll be doing little coding on the project. probably mostly code reviews, unit testing and planning. Should it have 1 file per screen, and parts that are repeated should have their own classes? should it be MVC? We're talking a 30k line app here, at its best and most efficient. is there a better way to break the code apart than the ways I've listed?

I guess my real question is, does anybody have good suggestions for books that would address my current issue? code clean was suggested, that's a good start. I've already read the mythical man month and code complete but they don't really address my current issue. i need suggestions for books that will help me learn how to structure and plan the creation of large code bases

share|improve this question

closed as too broad by rmaddy, hims056, Martin R, Gabriele Petronella, HalR Feb 1 '14 at 7:37

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

    
"Should it have 1 file per screen" This is a totally arbitrary metric. The short answer is to use as many files as you need. The long answer is to read the docs. I would start here. –  sosborn Feb 1 '14 at 5:29
2  
What you are asking is consultancy of project management. (I generally charge others 350$ an hour for that) but a brief intro would be , decide your team according to their strengths and then device the project to the technology that is going to handle. Give each team a small piece to start with and then add more to it when they are done. Time frame for completion is essential. Take a nice chunk of it yourself and ask them to help you with smaller parts of the big chunk. Set a time table for each section of the project and execute it as efficiently as you can. –  XCode Monkey Feb 1 '14 at 5:36
    
Basically, read all the advice there is and then ignore 90% of it. The trick is to pick the right 10% to not ignore. –  Hot Licks Feb 2 '14 at 0:14
    
@XCodeMonkey - $350 an hour?? I'm gonna have to have a conversation with my boss. –  Hot Licks Feb 3 '14 at 0:28

1 Answer 1

up vote 2 down vote accepted

As I'm sure you know this is a pretty vague question you could write a book answering it. In fact, I would recommend you read one, like Clean Code. But I'll take a stab at a 10,000 foot level overview.

First if you are doing an iPhone app, you will want to use MVC because that is how Apple has setup their frame work. That means each screen will have (at least) a view-controller, possibly a custom view or NIB.

In addition you will want your view controllers pointing to your model (your business objects) and not the other way around. These objects should implement the use cases without any user interface logic. That is what your view-controller and view will be doing.

How do you break apart your use cases? Well, that's highly specific to your program and I won't be able to tell you with a (lot of) details. There isn't a single right answer. But in general you want to isolate each object from other objects as much as possible. If ever object reference ever other object, then you don't really have an OO design, you have a mess. Especially when you are talking about unit tests and TDD. If when you test one part you end up pulling in the whole system, then you are not testing just one small unit, are you?

Really though, get a good book about OO design. It's a large subject that nobody will be able to explain in a SO answer. I think Clean Code is a good start, maybe other people will have other suggestions?

share|improve this answer
    
thanks for the answer. books are helpful. I've read code complete and the mythical man month but they don't really address the issue I'm facing at this immediate moment –  Deathstalker Feb 2 '14 at 0:05
    
I haven't read Code Complete and it may hav helpful ideas, but if I remember Mythical Man Month I would agree it's not as practical. Clean Code is all about how to structure your code and why, which is what you are asking and is why I recommend it to you in this case. Specifically chapter 3, functions and chapter 10 classes. It would only take a few hours to get through those chapters. Good luck. –  ansible Feb 2 '14 at 0:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.