Question

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.

Was it helpful?

Solution

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 ^^

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
scroll top