• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

source code and new version entegration problem

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I dont know if it is true to write here but I could not find any suitable topic.


I have full source code of a "project A" and I changed and am changing it according to our company's requirements.But when a new version of "A" is released the integrating our code to this new version by hand becomes an incredible big problem for me.

This project is a java based web application and we have already tried aspect programming,dynamic class loading,byte code engineering..etc but project has jsp files and these can not handle jsp files.

Is there a way to do that in an easy way?

Can you or someone offer a strategy to handle this ?

 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the problem about integration? Could you please to be more specific?
 
halil yildiz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for example, let X be a java class and has a Y function in it for version 1.0 of X and suppose that I modified Y function of this X class.

after that the company,which we bought the source code, releases a new version of X class.Let's suppose in this version company changed Y function of X class.In this sitution I have to put my code into the Y function again.This is the problem.

This operation is no problem for one java class or jsp file but when it becomes more and more complex I could not follow changes in classes and conflicts (if there exists).Actually conflicts are second problem and can be discussed later.

Maybe one way to do this is injecting the changes in new version to my code automatically.But how?
There can be another ways and I am looking for a solution

(By the way, I control my own versions with cvs.But company gives me no svn or cvs based project only the pure codes and jsps.)
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

halil yildiz wrote:for example, let X be a java class and has a Y function in it for version 1.0 of X and suppose that I modified Y function of this X class.

after that the company,which we bought the source code, releases a new version of X class.Let's suppose in this version company changed Y function of X class.In this sitution I have to put my code into the Y function again.This is the problem.


Don't do that, if you want almost functionality of a class except a single method, extend it and override that method.
Let's hope that the method is not final. You shouldn't modify classes from 3rd party, you should extend and override.
 
halil yildiz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that but some other classes also uses this Y function so if I extend it I must also change the declaration in other classes to use new extended class.So I have the same problem with a different view.

There is also jsp part of this problem.I wish I can extend JSPs but then I will have the same problem
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

halil yildiz wrote:I know that but some other classes also uses this Y function so if I extend it I must also change the declaration in other classes to use new extended class.So I have the same problem with a different view.


You should program to interface. Anyway if you know what should be done, do it no buts.
 
halil yildiz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kengkaj Sathianpantarit wrote:
You should program to interface.



I couldnt understand what you mean.


Kengkaj Sathianpantarit wrote:
Anyway if you know what should be done, do it no buts.



I didnt say that I know what to do, I wanted to say I tried a lot of ways to do this:


halil yildiz wrote:
aspect programming,dynamic class loading,byte code engineering..etc



and every solutions comes with another problem which depends on same issue:the code dependency.

 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should solve one problem at a time. Now the problem is you modify 3rd party code which will cause problem if the 3rd party updates version. The solution is simple: not do that. We shouldn't modify 3rd party code if the project is active and new versions get released often. We should extend and override some methods.

 
halil yildiz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right I shouldnt change a project which is still developing "but" this is not a solution to my question.

If you know a way to solve my problem please share it otherwise thanks for your help.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're going to modify source code outside of your control /and/ try to keep it up-to-date with the original source then you're going to have to deal with the pain.

When I've had to do this I've just kept the local code under version control. When a new version comes in I let the version control handle as much of the merge process as possible--depending on the nature of my local changes it's often very simple and I have almost nothing to do except run my tests.

The best way to go about this may depend on what kinds of changes you tend to make: small, localized changes, or major, system-wide changes.
 
halil yildiz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply I have been starting to panic for noone will understand my problem
I am using cvs for version controlling as I said and do the same as yours.I think I am on a right way then.
But in here there is another problem maybe you can help.
When a new version of a file comes, sometimes cvs recognize it as a completely changed file according to the previous version of it because of the disharmony of blanks or tabs.Did you ever face to face with a problem like that?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't really remember CVS; perhaps there's a setting to ignore whitespace?

You might want to pursue this further in the version control forum.
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!