Is "Undocumented Secrets of MATLAB Java Programming" by Yair Altman still up to date?
35 次查看(过去 30 天)
显示 更早的评论
I'm considering purchasing this book to get a better understanding of MATLAB's Java library but it was written in 2011.
Does anyone know if MATLAB's Java libraries have changed considerably since 2011?
If they have, what would be the most up to date source of information on this topic?
0 个评论
采纳的回答
Yair Altman
2023-10-21
编辑:Yair Altman
2023-10-21
As of the latest release (R2023b), most of what I posted over the years on the undocumentedmatlab.com website (and in the 2011 book) is still relevant and works just as it had a decade ago, including the undocumented reliance on (and customizations of) the legacy Java-based GUI. The new GUI functionality that has come into focus in recent years (uifigure, App Designer etc.) is based on non-Java technology (HTML & JavaScript). But the legacy Java-based GUI is still functional alongside the HTML/JS-based GUI, at least for now.
MathWorks invested most of its R&D efforts in recent years on the non-Java functionalities, so the Java-based Matlab code has remained largely unchanged so far. My guess is that perhaps 90% of the contents of the 2011 book is still relevant in R2023b, certainly the major concepts. Considering the fact that the undocumented aspects were always under the risk of being "removed without prior notice in a future Matlab relase", the fact that so many of them remained useful for so long (close to 2 decades in some cases) is absolutely amazing in my eyes. It's been a [very] long run, but nothing lasts forever.
Going forward, MathWorks will eventually stop supporting Java-based GUI to some degree (when and to which degree is not publicly known at this time). Note that this phase-out of Java was promised/warned-about for many years already (since 2016 I think), who knows when it will ever happen. Probably not more than a few years though. At that time, it is still unclear whether Java-based GUI customizations will break completely (run-time errors) or exhibit some sort of graceful degradation. AFAIK, MathWorks have so far not made any public comment about either the expected timeline or the behavior. I believe this vagueness is counter-productive, but they have their reasons.
In any case, even if and when the Java phase-out occurs, non-GUI Java-based functionality are expected to still work by loading a user-supplied JRE. As long as you specify a supported JRE and properly configure Matlab to use it, you should be able to keep using non-GUI Java in your Matlab programs, and probably also pure-Java GUI. Note that the interface to using external Java libs is fully documented just like the external interface to Python, C# etc. - there's no undocumented aspect here.
Also note that there are many undocumented aspects of Matlab that are not Java-based - these will probably continue to be relevant even once Java GUI is gone. These include a myriad number of hidden properties and methods of otherwise-documented Matlab objects.
All that being said, and in light of the eventual expected Java phase-out, I do not plan any new edition of my 2011 book "Undocumented Secrets of Matlab-Java Programming". In contrast, I do plan a 2nd edition of my 2015 book "Accelerating Matlab Performance", which is long overdue. But then again, so is MathWorks with its Java phase-out, so I think I'm in good company :-)
0 个评论
更多回答(2 个)
dpb
2023-10-21
<Mathworks is abandoning Java>, going forward, <Java will be just another external language>. There's no incentive to go down that route Yair was leading as MATLAB interface will (eventually) not be built around Java at all.
You could still as the second link shows, load JAR files and use Java, but the seamless interface won't be there with internals built upon it. My understanding is that Sun became much more beligerent about licensing issues and Mathworks didn't agree to go along for the ride.
2 个评论
Dyuman Joshi
2023-10-21
@dpb, would that include java libraries as well? For e.g. the java.math library (which has BigInteger and BigDecimal utilities/functionalities).
dpb
2023-10-21
As built ins, AFAIU, yes. As the link above states, you can still call Java methods, you'll just have to do so explicitly.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!