0

I am planning to start a small project with a friend. I will be developing the GUI using JavaFX in the MVC pattern and he will be responsible for the model/logic.

My question is: how can we achieve a save parallel developing, how do companies do that? Would we just write an interface for the model together, that specifies what functionality I will need in the controller and thus he has to implement?

Thx in advance.

closed as too broad by gnat, GlenH7, user40980, Ampt, psr Dec 11 '14 at 1:24

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask – gnat Dec 10 '14 at 10:54
  • This is not really something that you can try & error... – Benjoyo Dec 10 '14 at 10:57
  • I wrote that my idea would be interfaces. – Benjoyo Dec 10 '14 at 10:57
  • did you check How to Ask page referred in prior comment? "Search, and research Have you thoroughly searched for an answer before asking..." – gnat Dec 10 '14 at 10:58
  • I didn't find anything on how to develop in a team on the internet. – Benjoyo Dec 10 '14 at 11:07
1

To your specific question in terms of code: A good idea would be to use the facade pattern to have a single point of access to the model from the controllers, so you can always call the facade and don't have to think about how his model logic will deal with the request internally, or which classes he will use. Furthermore, if MVC is done correctly the model, view and controllers will be swappable (as in, you could develop the view/controllers in javaFX but someone else can just use the same model and write android views/activities to call the logic). Meaning that you should not tell him what to provide from a controller point of view, but you should have your controller work with what the model provides. Ofcourse, the model has to provide all the necesarry logic so here are some tips on how to achieve this in general.

To your question in general: If it's just you and a friend there are several things you can do to improve smooth development. Communication is important here, make sure you have predefined what you want to create and discuss some aspects of how this might be done.

Maybe create some user stories (http://en.wikipedia.org/wiki/User_story) or create a GUI mockup (each create a mockup, or you just create one) and discuss it. This will make you know what is required from a user point of view in the GUI, and he will see how your GUI handles this and will know which data will have to be provided by the model.

In addition you could try pair-programming, so he gets a feel for the view/controller code and you get a feel for the model code. Ofcourse you're not strictly developing apart anymore then, but rather together on some parts. Anyway, as it's only a two-man project and you both get along, this might be a fun and enriching experience.

Anyway, if you run into a problem where you think "Frick, I need this data but the facade doesn't expose it" you can just tell him that you need that bit of data and he can create a method in the facade that provides this. Sometimes requirements change or you have to do something you didn't think of before. That's software development though ^^

  • Glad you like them :) feel free to upvote or accept this answer to let other people whom have this question know it's a good answer :) – Dylan Meeus Dec 10 '14 at 12:28
  • 1
    I cannot upvote yet, but accept ^^ – Benjoyo Dec 10 '14 at 12:30
0

The best way is to develop the 2 aspects in different processes and use a form of IPC to communicate between the two. He will develop a "server" process that must define an API for you to use. (You don't have to use the client-server model like this so you could develop in 2 different linked modules, but it helps for testing and also helps to reuse the server components if you want to change the GUI to a web or mobile interface instead)

In any other form of doing what you want - ie 2 developers writing code in different, interlinking areas, the only sane way is to define the API regardless. Any other way will descend into a madness of chaotic developments where you continually break each others code.

Note that the API can continually evolve, often in response to your needs, but its usually a good idea to start with some form of design where you come up with a base from which to build on.

  • 2
    What does IPC bring to the table? Why not just host business logic in process? Why pay the price of IPC for no gain. I agree that defining interfaces is the right thing to do. – Esben Skov Pedersen Dec 10 '14 at 10:57
  • @EsbenSkovPedersen too quick Mr Pedersen, check my edit. I'd say its a good idea for them as they will be developing in completely independent projects then, so they won't tread on each others toes. It also prevents 'quick hack workarounds'. They could develop in dlls, or just shared directories, but I think client-server is a good way to teach them the separation. – gbjbaanb Dec 10 '14 at 10:59
  • Wouldn't this just be using pure MVC and then defining an interface for the model? Because MVC is designed for being able to switch the UI. – Benjoyo Dec 10 '14 at 11:14
  • I don't know. It seems to me IPC would bring additional complexity without any real benefit. – Esben Skov Pedersen Dec 10 '14 at 11:17
  • @Benjoyo When I say switch the UI, I mean switch the technology completely. You may develop a thick-client UI and then decide you want a web-based UI instead. Or you develop a Java Swing UI and then decide you want a C/OpenGL UI later. – gbjbaanb Dec 10 '14 at 11:44

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