phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Pass in only extractParticle() function to emitNucleon #152

Closed Luisav1 closed 1 year ago

Luisav1 commented 1 year ago

From #112.

zepumph commented 1 year ago

This is a reasonable thought, but I kinda think it is more trouble than it is worth. Much of the worry in regards to "only pass in what you need" is for class constructors, where by passing in a whole model class, you are more likely to use other stuff that further breaks encapsulation and muddy the exact purpose of your class. Here, it seems totally fine to provide a particleAtom to a function for extracting one of its particles.

I recommend closing this issue as a wontfix, but I'm happy to discuss further.

zepumph commented 1 year ago

@Luisav1 and I discussed and are in agreement.