How to reuse code in two similar projects

6

Conclude a project and need to do another with the same context. The problem is that I know I'm going to find bugs and I'll evolve the code when I'm developing the second one. Like I do in a way that I can correct a bug in both projects at once without having to open one by one and without having to lose the particularities that each one has.

    
asked by anonymous 14.02.2014 / 18:40

2 answers

5

Set up your Build Path to use source codes that are not within your project.

Click Link Source... and enter the path.

Do this in your two projects, this way you will have a unique base, every time you change the source code to one you will be changing the source code of the other as well. But you will have to make sure that the interface of each one is tracking the improvement of your code base.

    
14.02.2014 / 18:49
1

just take what is common for both and transform into a library, and then use the reference in the two

    
14.02.2014 / 18:42