07.01.2013 Views

David Defour - Université de Perpignan

David Defour - Université de Perpignan

David Defour - Université de Perpignan

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Pros and Cons of Approach<br />

• Advantages<br />

–Easy to access main app.<br />

• Methods in inner classes can access any public or private<br />

methods or instance variables of outer class.<br />

–Can pass arguments to run<br />

• As with separate classes, you pass args to constructor, which<br />

stores them in instance variables that run uses<br />

• Disadvantages<br />

710<br />

jeudi 26 janvier 12<br />

–Tight coupling<br />

• run method tied closely to this application<br />

–Danger of race conditions<br />

• You usually use this approach specifically because you want to<br />

access data from main application. So, if run modifies some<br />

shared data, you must synchronize.

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

Saved successfully!

Ooh no, something went wrong!