01.02.2013 Views

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The server tries to MERGE your changes<br />

If two people make changes to the same file but in different places,<br />

most version control systems try to merge the changes together. This<br />

isn’t always what you want, but most <strong>of</strong> the time it works great.<br />

Nonconflicting code and methods are easy<br />

In BeatBox.java, you added a playPoke() method, so the code<br />

on the version control server has that method. But Bob’s code has no<br />

playPoke() method, so there’s a potential problem.<br />

Bob’s BeatBox.java<br />

Nothing here... Bob has no<br />

code for playPoke() at all.<br />

Your version control s<strong>of</strong>tware will combine files<br />

In a case like this, your version control server can simply combine<br />

the two files. In other words, the playPoke() method gets<br />

combined with nothing in Bob’s file, and you end up with a<br />

BeatBox.java on the server that still retains the playPoke()<br />

method. So no problems yet...<br />

But conflicting code IS a problem<br />

But what if you have code in the same method that is different? That’s<br />

exactly the case with Bob’s version <strong>of</strong> BeatBox.java, and the<br />

version on the server, in the run() method:<br />

The version on the server has<br />

a playPoke() method.<br />

BeatBox.java<br />

version control<br />

if (nameToShow.equals(PICTURE_START_SEQUENCE)) {<br />

receiveJPEG();<br />

} else {<br />

if (nameToShow.equals(POKE_START_SEQUENCE)) {<br />

otherSeqsMap.put(nameToShow, checkboxState); playPoke();<br />

listVector.add(nameToShow);<br />

nameToShow = "Hey! Pay attention.";<br />

incomingList.setListData(listVector); }<br />

}<br />

otherSeqsMap.put(nameToShow, checkboxState);<br />

listVector.add(nameToShow);<br />

incomingList.setListData(listVector);<br />

Bob’s BeatBox.java<br />

private void playPoke() {<br />

Toolkit.getDefaultToolkit().beep();<br />

}<br />

Download at WoweBook.Com<br />

These two bits <strong>of</strong> code are in the same place,<br />

but it’s not clear how to merge them.<br />

BeatBox.java<br />

you are here 4 193

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!