2

I'm building a component that store info about the client and it stores only the numbers of the JApplicationWebClient constants instead the browser name, system name, etc, .

But if the constants change, things will get a bit messy.

2 Answers 2

2

Yes, software does change.

To somehow reverse the order of constants, so that CHROME is renamed from 19 to 5, would make little sense to me and very unlikely to happen.

Generally things change so that a problem can be solved (taking into account b/c). I would rather say there is a risk of this class being deprecated on the long run sometime later (Joomal 4 or Joomla 5) for whatever reasons.

Looking at the history of this class (since 2011), there have been little changes done (just additions), even since the Joomla Platform times till the new Joomla Framework. So I would say you are on the safe side, at least in 3.x and the foreseeable 4.x based on the Joomla Framework.

My advice: until you don't have a problem, don't spend your time fixing it (aka don't build on top of JApplicationWebClient if the current functionality works fine). If you need to read this information years later (5 -10 years), maybe from non-Joomla applications, maybe you should store strings (if storage is not an issue).

You should first start to worry when this class is deprecated.

1

Yes, they can change. I think it's not highly probable.

Nevertheless, you have to implement an abstraction layer to avoid any impact, or support several versions of JApplication clients.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.