Extending JME classes - private vs protected

I saw in many JME classes that extendability wasn't fully considered when they were created.

An example is TerrainPage.

I wanted to implement a way to update the whole heightmap of the terrainpage in realtime.

In order to do that i'd either extend TerrainPage class and do it or update TerrainPage

since TerrainPage is part of the package of JME if i do that i'll need to change that class every time I update which is boring :slight_smile:

Therefore extending it would be nice.

However… everything related on the heightmap comes from TerrainBlock which is private with no setter. Only getter…

This means if i want to simply change the heightmap of a TerrainBlock I need to create a new TerrainBlock which is extremely unefficient.


Without looking at the specific code you mentioned, I can say: extendability is a good thing as long as you respect encapsulation/responsibility. So… patches for adding setters or other access methods are welcome :slight_smile:

yes but if i patch it then it wont get in the core code

so at next release i'll have to patch it again right? …

You can submit patches here or on the issue tracker to get them incorporated into the core.