jmonkeyengine icon indicating copy to clipboard operation
jmonkeyengine copied to clipboard

DesktopAssetManager bad naming

Open Ali-RS opened this issue 3 years ago • 8 comments

DesktopAssetManager is a misnomer. It’s included in jme3-core and used both on desktop and mobile platforms.

What about renaming it to DefaultAssetManager?

Ali-RS avatar Apr 02 '21 17:04 Ali-RS

It can't just be renamed. Some apps create their own or have extended it and they would break.

At best, we'd have to deprecate it and have an upgrade path... but given that it's just a naming issue, I wonder if it's worth the trouble.

pspeed42 avatar Apr 04 '21 19:04 pspeed42

I thought it might be fine to target it for v3.4 (that lets breaking changes go in?)

Ali-RS avatar Apr 04 '21 19:04 Ali-RS

Technically it's nice to deprecate things first. Otherwise, what you end up with is just people using 3.3 forever and never upgrading because "it breaks a bunch of stuff and I don't have time to fix it all at once". Nicer if they can deal with some warnings over time.

Plus, this is a "we just don't like the name anymore" issue... which we decided in a few minutes without looking back at the history to make sure it's even correct. Maybe it's a bug that android is using DesktopAssetManager now? I'd have to do a lot more research personally before I was willing to rubber stamp this change because my memory says different things than the reality that I'm being presented.

There is no technical reason to change other than a little confusing for folks diving in deep.

pspeed42 avatar Apr 04 '21 20:04 pspeed42

It is also confusing if using in a server application, since it is not a desktop application.

tlf30 avatar May 26 '21 23:05 tlf30

What about renaming it to DefaultAssetManager?

I think yeah, and another approach may be creating DefaultAssetManager as a common interface at the jme3-core and deprecate the DesktopAssetManager at the jme3-core and migrate it to jme3-desktop and for android, create a new AndroidAssetManager that also extends the DefaultAssetManager, by doing this, we are not going to break anything and we can have android in a separate implementation process so it's easier to target android-only changes and desktop-only changes... What do you think ?

pavly-gerges avatar Jun 05 '22 10:06 pavly-gerges

That sounds generally okay, but perhaps more complex than is necessary. Do you anticipate any Android-only changes?

stephengold avatar Jun 05 '22 16:06 stephengold

That sounds generally okay, but perhaps more complex than is necessary. Do you anticipate any Android-only changes?

For now i don't, but for later may be, i think there might be changes for the manager in future, i fear there are still parts of the engine that uses reflection and are mandatory on android for example Class.forName("Foo"), Is this accounted as reflection, because internally it's ? if so we need to change the registerLocator() code for android and ..etc, i haven't debugged that DesktopAssetManager on android yet, the debugging logs will be our helpful tool though, it will show a blacklist calls with a denied access, tho everything will work fine, until you try to publish on google play.

pavly-gerges avatar Jun 05 '22 19:06 pavly-gerges

it will show a blacklist calls with a denied access, tho everything will work fine, until you try to publish on google play.

I tested and debugged this today, and fortunately it didn't show up a reflection call problems, i have looked back to android developer docs and it seems i have interpreted somethings wrong, sorry, it's my fault, you can continue your discussion here or on forums, i have no anticipated android changes for this.

pavly-gerges avatar Jun 11 '22 02:06 pavly-gerges