Is "Undocumented Secrets of MATLAB Java Programming" by Yair Altman still up to date?

조회 수: 45 (최근 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?

채택된 답변

Yair Altman
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 :-)

추가 답변 (2개)

dpb
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
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
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.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2023년 10월 21일
@Yair Altman has a new book out sometime in the past 2 or 3 years.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by