Mostrando las entradas con la etiqueta Java. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Java. Mostrar todas las entradas

domingo, septiembre 05, 2021

Utilidad de The Java Version Almanac

 Usualmente trabajo en Java 8, (como parte de otros lenguajes). La versión 8 es obligatoria como intersección de los distintos productos que se combinan en nuestro desarrollo (Plex, Websphere, C++, RPGIV, OS/400). Francamente, podríamos pasar a Java 9 sin problemas reales, pero sería ir un paso más allá de lo que el soporte de Plex reconoce. Es probable que terminemos haciéndolo durante el año, o poco después, de todas formas. Lo que parece un gran atraso respecto a la versión corriente (Java 15/16) y las versiones bajo desarrollo (Java 17/18), si consideramos que Java 8 es por ahora la anteúltima versión estable (LTS), seguida por Java 11, y en espera de Java 17. El sistema adoptado por Oracle de desarrollo de Java en versiones con pequeños cambios graduales, favorece el avance de versión analizando el impacto que puede tener el paso a la siguiente, considerando los releases mayores como objetivos principales. Sobre el plan de desarrollo de Java, dice Oracle:

For product releases after Java SE 8, Oracle will designate a release, every three years, as a Long-Term-Support (LTS) release. Java SE 11 is an LTS release. For the purposes of Oracle Premier Support, non-LTS releases are considered a cumulative set of implementation enhancements of the most recent LTS release. Once a new feature release is made available, any previous non-LTS release will be considered superseded. For example, Java SE 9 was a non-LTS release and immediately superseded by Java SE 10 (also non-LTS), Java SE 10 in turn is immediately superseded by Java SE 11. Java SE 11 however is an LTS release, and therefore Oracle Customers will receive Oracle Premier Support and periodic update releases, even though Java SE 12 was released. (en It's time to move to Java 17, Johan Janssen, 27 de agosto de 2021, Java Magazine)

Marc R. Hoffmann y Cay S. Horstmann han desarrollado un cuadro que despliega el inventario de todas las versiones de Java existentes, su soporte, y el análisis de los cambios existentes de versión a versión, a nivel de clase y método. Este cuadro es un auxiliar imprescindible a la hora de planear una meditada actualización a niveles superiores. Se trata de un gran trabajo, que al menos a mí me resulta de consulta obligatoria. Ojalá otros productos relacionados tuvieran un cuadro similar (estoy pensando en Apache POI, donde suelo necesitar la inferencia y el análisis de casos para concluír qué debo usar).

The Java Version Almanac, javaalmanac.io


 

sábado, septiembre 05, 2015

De Eclipse a IntelliJ...y vuelta

El año pasado hubo mucho ruido con el congelamiento de los desarrollos de Android para Eclipse, y el paso a su IDE propia, y el gran crecimiento del respaldo a IntelliJ tanto para desarrollos con Android, como en general para Java. Contínuamente se podía observar la adopción de IntelliJ Idea por nuevos desarrolladores.
Pero ahora parece haberse presentado un cambio de política comercial de JetBrains, dueño de la herramienta, un cambio que pone en evidencia el punto débil del movimiento hacia su IDE desde Eclipse: está anunciado un nuevo modelo de relación comercial basado en la renta y no la venta de sus productos.
Basicamente, el nuevo "comprador" ya no será dueño de su instalación, salvo durante el período de renta. Es decir, esto es lo que va desde un producto construído por una amplia comunidad, capaz de evolucionar basado en el interés de sus participantes, a otro condicionado a las estrategias comerciales de sus propietarios. Como dice algún comentarista (Mike Milinkovich), aunque esta medida hoy vuelva atrás, marca una diferencia fundamental en las estrategias y horizontes de uno y otro producto.

domingo, mayo 10, 2015

Java en el System i

La JVM de IBM vs el JDK clásico. Cap 13, pag 591
Continuando el comentario (y recomendación de su  lectura) del Red Book sobre modernización del System i, dos palabras sobre Java en  el i.

Siempre se discute la lentitud de Java y su manejo de espacio de memoria, pero deberíamos decir que esto depende mucho  de la implementación y del aprovechamiento de las herramientas disponibles. Particularmente, IBM ha hecho un cambio radical en la JVM: el reemplazo por la implementacion de IBM,  Por experiencia, hemos pasado por casos que comenzaron con fallos y caídas, y fueron ajustados y optimizados hasta pasar a un funcionamiento absolutamente normal. En el capítulo 13 del red book, se comenta sobre la lentitud de Java (13.3.2 Myths surrounding Java: Java is slow)
Is Java really slow? It depends on what you compare it to. (...) you must choose the correct tool for the job. If what you need is high performance, you must select a lower-level language, such as C/C++ or RPG, but if you are dealing with huge and complex applications, it might be better to use a language with more flexibility, such as Java.
The reputation for slowness that Java usually carries is related to the JVM and not the language itself. The Java language is dependent on multithreads and large amounts of memory. Many people who are accustomed to running other languages starve their Java applications, which causes terrible performance. On the IBM side, the Classic JVM was not designed for IBM POWER architectures. It was ported from the original Oracle version, which resulted in performance issues. However, IBM Technology for Java is designed for the platform and it has been highly optimized by IBM to leverage the Power architecture. With this new version of Java, you can take advantage of the multithreading nature of Java, which was not possible before. Lastly, processor technology has improved greatly over the past few years. Processors are geared toward multithreading, which is a significant boost to Java based applications.
 
Disponible desde 1998, ha pasado mucho desde su introducción en el System i, progresando hasta ser hoy una alternativa confiable. IBM comenzó ofreciendo soporte a la JVM clásica de Java, hasta que decidió atacar los problemas de adecuación a la plataforma, desarrollando su propia versión, tanto de un conjunto de clases y servicios que explotan los recursos nativos del equipo (IBM Toolbox for Java), como de una propia JVM, que ajusta la versión clásica desarrollada hoy por Oracle:
Java on IBM i can take advantage of the 64-bit architecture of the systems to provide a scalable solution from single processor machines all the way up to multiprocessor machines. The Classic JVM was unique in its implementation of asynchronous garbage collection, which allowed the JVM to continue processing application requests during the garbage collection cycle.
Nevertheless, this uniqueness of the Classic JVM became a disadvantage. For many developers and vendors, it required much work to port their applications to the IBM i, which disabled the portability features of the Java platform. This also resulted in more expenses to IBM and slower releases of the new Java versions and updates. In addition, the Classic JVM was based on porting code that was not tuned to the features built within the IBM PowerPC architecture. Starting in V5R4, IBM i started to move away from the Classic version of Java and support for Classic is now stabilized. Today, Java is delivered on IBM i only through the IBM Technology for Java version.  (...) Initially the IBM Technology for JVM was implemented only on 32-bit architecture, but since IBM i 6.1, the 64-bit version is available for use. This gives more flexibility for developers, allowing them to fit the JVM according to their needs.
Este es un aspecto importante a tener en cuenta: las nuevas ediciones del sistema operativo implementan sólo la versión de Java de IBM. Así, Java 7 es implementada solamente en la versión de IBM. Sin embargo, esto no debería alterar la ejecución de código, sino explotar la posibilidad de usar de manera nativa servicios y posibilidades del sistema operativo y de la base de datos. El "IBM Toolbox for Java" y su equivalente open source JTOpen ofrecen un excelente medio de interactuar con los recursos del sistema.

En nuestro caso, el desarrollo de aplicaciones web con Webclient, que utiliza java como capa intermedia, nos ha dado oportunidad de comprobar la posibilidad de usar java sobre el System i. Básicamente, nuestras aplicaciones se ejecutan sin diferencias (salvo extensiones que concientemente explotan facilidades del sistema) sobre servidores Websphere en System i, iSeries o como se le llame, y sobre servidores Tomcat o Jetty (en este caso sólo para pruebas). Y quisiera decir que, además, las herramientas de análisis de problemas y performance que Websphere ofrece, son superiores al momento de tener que estudiar problemas. Probablemente, la posibilidad de usar Java nativamente es una de las mejores garantías de modernización y explotación del equipo, convirtiéndose en un puente entre el mundo móvil, web y de recursos infinitos que propone IOT, y la potencia de procesamiento y de manejo de datos del i.

martes, abril 07, 2015

Diez reglas para recordar (y seguir...)

Firmado por Javin Paul, un artículo que recuerda diez reglas importantes de orientación a objetos en el diseño con Java (10 Object Oriented Design Principles Java Programmer should know), que podríamos extender fácilmente a otros campos (y estoy pensando en Plex). Un pequeño decálogo, tan escueto que podríamos pegarlo en una pizarra frente a nuestros ojos, y que deberíamos repasar todos los días.
 DRY (Don't repeat yourself)
Our first object oriented design principle is DRY, as name suggest DRY (don't repeat yourself) means don't write duplicate code, instead use Abstraction to abstract common things in one place. If you have block of code in more than two place consider making it a separate method, or if you use a hard-coded value more than one time make them public final constant. Benefit of this Object oriented design principle is in maintenance. It's important  not to abuse it, duplication is not for code, but for functionality . It means, if you used common code to validate OrderID and SSN it doesn’t mean they are same or they will remain same in future. By using common code for two different functionality or thing you closely couple them forever and when your OrderID changes its format , your SSN validation code will break. So beware of such coupling and just don’t combine anything which uses similar code but are not related.

Encapsulate What Changes
Only one thing is constant in software field and that is "Change", So encapsulate the code you expect or suspect to be changed in future. Benefit of this OOPS Design principle is that Its easy to test and maintain proper encapsulated code. If you are coding in Java then follow principle of making variable and methods private by default and increasing access step by step e.g. from private to protected and not public. Several of design pattern in Java uses Encapsulation, Factory design pattern is one example of Encapsulation which encapsulate object creation code and provides flexibility to introduce new product later with no impact on existing code.

Open Closed Design Principle
Classes, methods or functions should be Open for extension (new functionality) and Closed for modification. This is another beautiful SOLID design principle, which prevents some-one from changing already tried and tested code. Ideally if you are adding new functionality only than your code should be tested and that's the goal of Open Closed Design principle. By the way, Open Closed principle is "O" from SOLID acronym.

Single Responsibility Principle (SRP)
Single Responsibility Principle is another SOLID design principle, and represent  "S" on SOLID acronym. As per SRP, there should not be more than one reason for a class to change, or a class should always handle single functionality. If you put more than one functionality in one Class in Java  it introduce coupling between two functionality and even if you change one functionality there is chance you broke coupled functionality,  which require another round of testing to avoid any surprise on production environment.

Dependency Injection or Inversion principle
Don't ask for dependency it will be provided to you by framework. This has been very well implemented in Spring framework, beauty of this design principle is that any class which is injected by DI framework is easy to test with mock object and easier to maintain because object creation code is centralized in framework and client code is not littered with that.There are multiple ways to  implemented Dependency injection like using  byte code instrumentation which some AOP (Aspect Oriented programming) framework like AspectJ does or by using proxies just like used in Spring. See this example of IOC and DI design pattern to learn more about this SOLID design principle. It represent "D" on SOLID acronym.

Favor Composition over Inheritance
Always favor composition over inheritance ,if possible. Some of you may argue this, but I found that Composition is lot more flexible than Inheritance. Composition allows to change behavior of a class at runtime by setting property during runtime and by using Interfaces to compose a class we use polymorphism which provides flexibility of to replace with better implementation any time. Even Effective Java advise to favor composition over inheritance.

Liskov Substitution Principle (LSP)
According to Liskov Substitution Principle, Subtypes must be substitutable for super type i.e. methods or functions which uses super class type must be able to work with object of sub class without any issue". LSP is closely related to Single responsibility principle and Interface Segregation Principle. If a class has more functionality than subclass might not support some of the functionality ,and does violated LSP. In order to follow LSP SOLID design principle, derived class or sub class must enhance functionality, but not reduce them. LSP represent  "L" on SOLID acronym.

Interface Segregation principle (ISP)
Interface Segregation Principle stats that, a client should not implement an interface, if it doesn't use that. This happens mostly when one interface contains more than one functionality, and client only need one functionality and not other.Interface design is tricky job because once you release your interface you can not change it without breaking all implementation. Another benefit of this design principle in Java is, interface has disadvantage to implement all method before any class can use it so having single functionality means less method to implement.

Programming for Interface not implementation
Always program for interface and not for implementation this will lead to flexible code which can work with any new implementation of interface. So use interface type on variables, return types of method or argument type of methods in Java. This has been advised by many Java programmer including in Effective Java and head first design pattern book.

Delegation principle
Don't do all stuff  by yourself,  delegate it to respective class. Classical example of delegation design principle is equals() and hashCode() method in Java. In order to compare two object for equality we ask class itself to do comparison instead of Client class doing that check. Benefit of this design principle is no duplication of code and pretty easy to modify behavior.
Y volviendo sobre la idea de su aplicabilidad en Plex, sin duda lo es. En algunos casos fácilmente entendible, (Favor Composition over Inheritance, Encapsulate What Changes, DRY,  Favor Composition over Inheritance) y en otros casos, después de luchar contra la vía fácil de hacer las cosas (Programming for Interface not implementation). Solo veo difícil implementar Dependency Injection. Y cuando me refiero a aplicabilidad, lo hago a nivel del modelo, no a nivel del código generado, donde su aplicabilidad está asegurada.
Plex, como otros productos, admite distintas interpretaciones, distintas formas de desarrollar. Aplicar principios de OOD permite explotarlo en forma más productiva, potenciando sus características. Luchar por no usar una hoja de ruta rutinaria favorece resultados consistentes y duraderos.

domingo, febrero 22, 2015

James Ward sobre Java

James Ward, de Salesforce, escribió el pasado mes de diciembre una  nota sobre Java (y alrededores). Una excelente lectura sobre java para aplicaciones web, y seguramente adaptable a otros escenarios. En realidad, se trata de una recomendación basada en experiencia acerca de la adopción de métodos ágiles y el recurso a herramientas de automatización y sistematización del proceso de contrucción (e implementación) de aplicaciones. No quiero repetirlo, pero sí recomendarlo. En todo caso, quisiera citar su reflexión sobre el mantenimiento de releases "monolíticos" (trabajar para entregas en series de tiempo y desarrollo prolongadas):

Monolithic Releases Suck

Unless you work for NASA there is no reason to have release cycles longer than two weeks. It is likely that the reason you have such long release cycles is because a manager somewhere is trying to reduce risk. That manager probably used to do waterfall and then switched to Agile but never changed the actually delivery model to one that is also more Agile. So you have your short sprints but the code doesn’t reach production for months because it would be too risky to release more often. The truth is that Continuous Delivery (CD) actually lowers the cumulative risk of releases. No matter how often you release, things will sometimes break. But with small and more frequent releases fixing that breakage is much easier. When a monolithic release goes south, there goes your weekend, week, or sometimes month. Besides… Releasing feels good. Why not do it all the time?
Moving to Continuous Delivery has a lot of parts and can take years to fully embrace (unless like all startups today, you started with CD). Here are some of the most crucial elements to CD that you can implement one-at-a-time:
  • Friction-less App Provisioning & Deployment: Every developer should be able to instantly provision & deploy a new app.
  • Microservices: Logically group services/apps into independent deployables. This makes it easy for teams to move forward at their own pace.
  • Rollbacks: Make rolling back to a previous version of the app as simple as flipping a switch. There is an obvious deployment side to this but there is also some policy that usually needs to go into place around schema changes.
  • Decoupled Schema & Code Changes: When schema changes and code changes depend on each other rollbacks are really hard. Decoupling the two isolates risk and makes it possible to go back to a previous version of an app without having to also figure out what schema changes need to be made at the same time.
  • Immutable Deployments: Knowing the correlation between what is deployed and an exact point-in-time in your SCM is essential to troubleshooting problems. If you ssh into a server and change something on a deployed system you significantly reduce your ability to reproduce and understand the problem.
  • Zero Intervention Deployments: The environment you are deploying to should own the app’s config. If you have to edit files or perform other manual steps post-deployment then your process is brittle. Deployment should be no more than copying a tested artifact to a server and starting it’s process.
  • Automate Deployment: Provisioning virtual servers, adding & removing servers behind load balancers, auto-starting server processes, and restarting dead processes should be automated.
  • Disposable Servers: Don’t let the Chaos Monkey cause chaos. Servers die. Prepare for it by having a stateless architecture and ephemeral disks. Put persistent state in external, persistent data stores.
  • Central Logging Service: Don’t use the local disk for logs because it prevents disposability and makes it really hard to search across multiple servers.
  • Monitor & Notify: Setup automated health checks, performance monitoring, and log monitoring. Know before your users when something goes wrong.
There are a ton of details to these that I won’t go into here. If you’d like to see me expand on any of these in a future blog, let me know in the comments.
Un punto importante, pero recordado sólo con el propósito de que lea completa la reflexión de James Ward, que lo merece.

martes, diciembre 30, 2014

Lanzamiento del nuevo release Plex 7.2

Ayer CA comunicó la disponibilidad del release 7.2 de Plex. Mucho se ha conversado sobre qué incluiría, pero nada es adelantado en el anuncio. Lo que sí es adelantado es algo ya conocido, pero igualmente muy prometedor: la adopción de una política de releases incrementales rápidos, y con participación directa de todos aquellos clientes que deseen sumarse al plan:
The CA Incremental Release Program is a customer-interactive delivery model where new product features are developed and released using the Agile development methodology. CA’s development teams work closely with customers to create product features for rapid implementation. Rather than spending years building a software release full of features, we work with customers and release features incrementally, as they are completed.
El lanzamiento de la versión 7.2 es una confirmación de esta política, acortando todavía más los tiempos de entrega ya vistos entre la versión 7.0 y 7.1.
De la documentación inicial se desprende que el grueso de los cambios se concentran en la variante .NET y en WCF Service Connectors, el agregado de soporte para Oracle 12, y la esperada actualización del soporte de Visual Studio...2010. Se afirma que es posible el soporte de versiones superiores, pero no está testeado (VS 2013). En cuanto a Java, continúa soportado hasta la versión 7 (ya existente en 7.1) y en cuanto a OS400, el soporte alcanza a IBM i 7.1.
Evidentemente, hace falta la participación de la base de clientes, si queremos ver otras nuevas características disponibles.
Plex 7.2 en la wiki oficial (CA).
Lista de fixes en la wiki oficial de Plex.
Matriz de compatibilidad de Plex 7.2 (requiere usuario).

martes, agosto 12, 2014

Internet Explorer ajusta el control de Java

Aunque semioficialmente en el blog de IE en MSDN se presenta como el comienzo del bloqueo de ActiveX obsoletos, y así lo puede encontrar anunciado en cualquier búsqueda, de lo que se trata en verdad es del bloqueo de versiones obsoletas de java, tal como Firefox, por ejemplo, también viene haciendo. Me interesé especialmente porque desde hace tiempo la tecnología de ActiveX viene siendo dejada más o menos de lado en Windows, y quizá esperaba ver alguna clase de búsqueda heurística que definiera qué parámetros determinarían el veto de un ActiveX. Pero parece ser que se trata de revisar una lista, formada sólo por versiones de java (¿se podría modificar la lista?).
Tratándose de algo relativamente simple, todas las versiones de IE activas (8 a 11) comenzarán a poner en práctica el bloqueo a partir del 9 de septiembre.
El alcance del control:
The out-of-date ActiveX control blocking feature works with:
  • On Windows 7 SP1, Internet Explorer 8 through Internet Explorer 11
  • On Windows 8 and up, Internet Explorer for the desktop
  • All Security Zones—such as the Internet Zone—but not the Local Intranet Zone and the Trusted Sites Zone
This feature does not warn about or block ActiveX controls in the Local Intranet Zone or Trusted Sites Zone.
Nótese que en Windows 8, sólo se menciona Internet Explorer for the desktop. Kurt Mackie, en Redmond Magazine, justifica esto en que no es posible instalar java en Metro (The blocking isn't happening for IE on the Windows 8 and Windows 8.1 Windows Store Apps ("Metro") side because the Windows Store Apps browser only supports the Adobe Flash Player add-on, but not other add-ons)
Versiones de Java vetadas en la lista:
J2SE 1.4, everything below (but not including) update 43 
J2SE 5.0, everything below (but not including) update 71 
Java SE 6, everything below (but not including) update 81 
Java SE 7, everything below (but not including) update 65 
Java SE 8, everything below (but not including) update 11
De las preguntas y respuestas:
Which outdated ActiveX controls are covered in this update?
No ActiveX controls will be affected when the feature is initially released in August. In September, only out-of-date Oracle Java ActiveX controls will be affected. All other ActiveX controls will continue existing behavior.
Is out-of-date Java the only ActiveX control being blocked by this feature in September?
In September, yes, only out-of-date Oracle Java ActiveX controls will be blocked by this feature. However, Internet Explorer will consider blocking additional common, but out-of-date ActiveX controls in future updates.
Can this feature be disabled if my enterprise requires an older version of the Java runtime?
Yes, there are several ways to disable this feature. Microsoft provides updated IE group policy administrative templates which include 4 new group policies to control this feature*. Two of these group policies can be used to disable this feature on a per domain basis or entirely.
My enterprise has line-of-business web sites that depend on out-of-date Java ActiveX controls in the Internet zone, will they be affected?
Out-of-date Java ActiveX controls will not be initially affected, giving customers thirty days to test and manage their environments. After September 9, when end users attempt to load the out-of-date Java ActiveX control, a prompt will be shown to the user (as described in earlier in the post). The end user will be able to click the “Run this time” option to load the out-of-date Java ActiveX control. Once loaded, the Java out-of-date ActiveX control will work as usual.
Can end users choose to override the prompt if a trusted application requires out-of-date Java use?
Yes, users can choose the “Run this time” option for internet sites requiring out-of-date ActiveX control use.
En fin, por ahora, el único peligro es Java. Tiene 30 días desde el 9 de septiembre para inventariar sus aplicaciones con versiones de java listadas, y buscar una solución. De todas formas, en el peor de los casos es posible deshabilitar completamente esta política. Una discusión sobre las políticas de exclusión en el comentario de Ed Bott.

lunes, abril 21, 2014

Migrando a System i 7.1

En un proyecto en el que trabajo, en poco tiempo más (midiendo en meses) migraremos un conjunto de sistemas IBM i (AKA AS/400, iSeries, al menos en su base), de 6.1 a 7.1, mientras que IBM ya anuncia i 7.2 . El cambio no representa  inconvenientes mayores: probablemente no haya demasiado que tocar en aquellas aplicaciones que generamos con Plex, que básicamente no debemos recompilar ni tampoco rehacer código.Únicamente deberíamos asegurarnos de que ningún API usada o procedimiento de lenguaje de control pudiera entrar en conflicto por obsolescencia. De acuerdo a la información adelantada por IBM, los problemas no vendrían por este lado. Es casi seguro que podremos seguir trabajando todas nuestras aplicaciones RPG, sus APIs, y nuestro CLs, sin modificaciones.
En cambio, tenemos asegurado trabajo de revisión con Java, quizá el área de mayores novedades en el software incluído para la versión 7.1, ya que, si consideramos que nos movemos desde 6.1, debemos tener en cuenta que la nueva versión abandona la máquina virtual estándar de Java (esta parte tampoco nos afecta, porque Websphere 7.0 ya la usa), y utiliza sólo la propia de IBM (J9). Esto sí requiere análisis y tests para aquellas aplicaciones que no se ejecutan con Websphere.  En el caso del servidor de aplicaciones, que es el que usamos relacionado con Plex, estimo que podremos mantener inicialmente la versión 7 de Websphere, que ejecuta Java 6, pero en algún momento debemos pensar en subir su versión a 8.1, que usa Java 7. Y esto implica que también deberemos planear la migración de Plex a 7.1. No es obligatorio, ya que podríamos mantenernos como hasta ahora, pero debemos pensar que también podemos llegar a estar presionados por los cambios en Windows, de 7 a 8.
A pesar de todos estos movimientos, no es mucho lo que impacta en nuestras aplicaciones, que se mantienen con cierta holgura en estos movimientos de versiones. Más bien, lo que debemos repensar es qué cosas podríamos reenfocar, sacando provecho de las nuevas posibilidades: gran parte de los cambios se manifiestan como extensiones. Mayor es el peligro si habláramos de dependencia de Windows, ya que el paso de 7 a 8 sí apunta a un cambio de arquitectura mayor. Pero de estos inconvenientes podemos hablar mejor en otro momento.
Dany Burger, en The Four Hundered, dedica un interesante artículo a los problemas de migración de i 6.x a i 7.1 y 7.2, que me motivaron a chequear nuestros propios riesgos a futuro. Como en otras ocasiones, es de reconocer y agradecer la política de cambio y migración de IBM y el iSeries (o como lo llames), que difícilmente te deje en una situación de callejón sin salida con una aplicación antigua: se puede evolucionar gradualmente sin tirar lo que ya está hecho.

jueves, febrero 20, 2014

Tropezando en software mal terminado

Alguna vez, James Bach decía que hoy no tenía sentido el testeo del software, porque no existía uno que se entregara con una revisión cuidada. Mejor en sus palabras, allá por marzo de 2009:
My impression is that up to about ten years ago most companies were still trying, in good faith, to put out a good product. But now many of them, especially the biggest ones, have completely given up. One sign of this is the outsourcing trend. Offshore companies, almost universally, are unwilling and unable to provide solid evidence of their expertise. But that doesn’t matter, because the managers offering them the work care for nothing but the hourly rate of the testers. The ability of the testers to test means nothing. In fact, bright inquisitive testers seem to be frowned upon as troublemakers.
(...) This is my Quality is Dead hypothesis: a pleasing level of quality for end users has become too hard to achieve while demand for it has simultaneously evaporated and penalties for not achieving it are weak. The entropy caused by mindboggling change and innovation in computing has reached a point where it is extremely expensive to use traditional development and testing methods to create reasonably good products and get a reasonable return on investment. Meanwhile, user expectations of quality have been beaten out of them. When I say quality is dead, I don’t mean that it’s dying, or that it’s under threat. What I mean is that we have collectively– and rationally– ceased to expect that software normally works well, even under normal conditions. Furthermore, there is very little any one user can do about it.
Esta incómoda afirmación de un especialista, se puede comprobar a diario, a cualquier nivel. Un incidente esta semana pasada me lo hizo recordar: migraba en Eclipse la versión de una librería que uso, a su último fix (esto sólo ya daría para hablar largo sobre políticas de entrega de producto). Ésto, mientras a la vez migraba de sistema operativo y máquina: demasiados frentes abiertos; Windows 7 a su último nivel crítico de actualizaciones, Visual Studio y Java instalados por primera vez en la máquina; en este último caso, a las instalaciones de JRE de Java 6 y Java 7, agregamos la instalación del JDK de JEE 6, tomando la última versión ofrecida por Oracle en su sitio de descargas para JEE 6: la que se instala con Java SE modificación 29.
Haciendo las primeras pruebas de funcionamiento de Eclipse con el proyecto en que trabajaba, encontré que la primera aplicación que probaba fallaba a poco de iniciarse. Después de algo de búsqueda, el problema quedó localizado en la primera llamada a Microsoft SQL Server, con la particularidad de que la llamada al driver sqljdbc4.jar recibía el control, y comenzaba la descarga de clases necesarias, hasta detenerse en una llamada en particular, sin provocar una excepción: simplemente la aplicación se colgaba sin aviso de ningún tipo, ni siquiera en el visor de eventos de Windows. La primera acción fue comparar la carga de clases en las dos máquinas involucaradas (la que estaba migrando, y la de destino, nueva), y tratar de asegurar que no se estuviera solicitando una clase que faltara en el jar cargado. Una búsqueda en todas las carpetas encontró no menos de seis copias del jar, pero ninguno de ellos podría haber entrado en conflicto, y la copia que debiera llamarse estaba en la ruta esperada. A pesar de que hubo que hacer algo de limpieza del número de copias y de sus rutas, este no era el problema. Por lo tanto, decidí comenzar una búsqueda de incidencias entre Java,  JEE, servlets, Microsoft SQL Server jdbc, y/o SQL en general. A poco de revisar, apareció una consulta en StackOverflow, que vinculaba la incidencia a la modificación 29 de Java SE. Siguiendo su discusión, llegué al caso en Oracle: JDK-7103725 : REGRESSION - 6u29 breaks ssl connectivity using TLS_DH_anon_WITH_AES_128_CBC_SHA. En la evaluación del impacto del fallo, se afirma: "The more obvious impact of this bug is to the MS JDBC Driver and MS SQL Server".
Tanto los comentarios en StackOverflow como la propia descripción del problema corregido coincidían en sus efectos con el que nos afectaba. De modo que, siguiendo las líneas recomendadas allí,  descargamos una versión posterior de Java SE,  la última disponible para Java 6, la modificación 45. Reemplazada la versión, no hubo más que arrancar Eclipse y la aplicación para encontrar todo trabajando normalmente...
Ahora, atemos nuestro percance con lo que James Bach dice más arriba: cuando instalábamos esta máquina, buscamos el paquete de JEE 6 en su sitio oficial, donde JEE 6 con el sdk de Java SE m29 es una de las opciones disponibles. Si bien la elección entre varias opciones fue nuestra, no existía ninguna advertencia de dificultades con JDBC (!) o SQL Server ni su documentación advierte que existe un problema, y que para resolverlo...se debe cambiar de versión. ¿Qué clase de entrega de un producto es una que no dice que fallará bajo ciertas circunstancias, para más, bastante comunes, cuando eso ya fue detectado? ¿Qué protocolo de comunicación existe entre quienes desarrollan el producto (JEE) y quienes lo mantienen (Java Community)?
Este es sólo un minúsculo ejemplo; sólo en el proceso de resolver este inconveniente podría hablar de varias imperfecciones de todo tipo, tan simples como insólitos resultados de la búsqueda de un objeto en el sistema de archivos (fallo en Windows 7), o la imposibilidad de usar las herramientas de desarrollador en Internet Explorer. O encontrar que un fix produce otro fallo que requiere otro fix al día siguiente...y otro más un día después.
En una época en que los métodos ágiles predominan, conjeturo que algo de responsabilidad les corresponde: reducir los tiempos de entrega, simplificar las metas de cada release, creo que también conducen a este estado de permanente falta de terminación.

sábado, diciembre 29, 2012

Java legacy, II

A propósito de las afirmaciones sobre la declinación de Java, mayores hacia inicios de año que ahora, Martijn Verburg, en su revista de Java para 2012, se refiere al tema y lo refuta claramente:
The community continues to thrive despite many main stream tech media reports of ‘developers leaving the Java platform’ or ‘Java is dead’. There are more Java User Groups (JUGs) than ever before, consisting of ~400,000 developers world wide.
Notably, one of them, the London Java Community won several awards including the Duke’s Choice award and JCP Member of the Year (along with SouJava – the major Brazilian JUG).

The conference circuit is bursting at the seams with large, sold out in advance, world-class Java conferences such as JFokus, Devoxx and of course JavaOne. In addition to this the host of regional conferences that often pack in an audience of over 1000 people all continued to do well.
Oracle’s Java Magazine was launched and has grown to over 100,000 subscribers. Stalwarts like JaxEnter, Coderanch and the Javaposse continue to grow in audience sizes.

OpenJDK

Further OpenJDK reforms happened over 2012 and a new scorecard is now in place for the wider community to give feedback on governance, openness and transparency.
2012 also saw a record number of individuals and organisations joining OpenJDK. In particular, the port to the ARM processor and support for running Java on graphic cards (Project Sumatra) were highlights this year.

Java Community Process (JCP)

The Java Community Process (JCP), Java’s standards body also continued its revival with record numbers of new sign-ups and a hotly contested election. As well as dealing with the important business of trademarks, IP and licensing for Java, a re-focus on the technical aspects for Java Specification Requests (JSRs) occurred. In particular the new Adopt a JSR programme is being strongly supported by the JCP.

Java and the JVM

The JVM continues to improve rapidly through OpenJDK – the number of Java Enhancement Proposals (JEPs) going into Java 8 is enormous. Jigsaw dropping out was a disappointing but given the lack of broader vendor support and the vast amount of technical work required, it was the correct decision.

JEE / Spring

JEE7 is moving along nicely (and will be out soon), bringing Java developers a standard way to deal with the modern web (JSON, Web Sockets, etc). Of course many developers are already using the SpringSource suite of APIs but it’s good to see advancement in the underlying specs.

Rapid Web Development

Java/JVM based rapid web development frameworks are finally gaining the recognition they deserve. Frameworks like JBoss’s SEAM, Spring Roo, Grails, Play etc all give Java developers parity with the Rails and Django crowd.

Mechanical Sympathy

A major focus of 2012 was on Mechanical Sympathy (as coined by Martin Thompson in his blog). The tide has turned, and we now have to contend with having multi-core machines and virtualised O/S’s. Java developers have had to start thinking about how Java and the JVM interacts with the underlying platform and hardware.
Performance companies like jClarity are building tooling to help developers understand this complex space, but it certainly doesn’t hurt to get those hardware manuals off the shelf again!
Y cuando Martijn se refiere a las perspectivas de 2013, la expectativa persiste, con Java 8 en deliberación. Pero mejor vea el artículo, o siga Java Code Geeks. Al menos en mi caso, encuentro usualmente excelente material práctico con ellos.

miércoles, diciembre 26, 2012

¿Java Legacy?

Esta es una noticia "vieja": InfoQ comenta la migración de Twitter de Ruby a Java a propósito de la exitosa travesía de Twitter durante las elecciones estadounidenses. Twitter resistió 327.452 tweets por minuto, hasta 15.107 tweets por segundo en algunos momentos, sin caídas de proceso ni congestionamientos. InfoQ atribuye (en parte) esta mejora a la migración desde Ruby hacia java:
[ dice Mazen Rawashdeh, VP de Infrastructure Operations Engineering en Twitter]Part of the reason Twitter was able to sustain this level of traffic was down to a set of changes the company has been making to their infrastructure, including, as InfoQ previously reported, a gradual shift away from Ruby to a set of services written in a mixture of Java and Scala and running on the JVM.
InfoQ historia este proceso gradual de migración:
Twitter was at one time thought to be the largest Ruby on Rails shop in the world, and has made a substantial investment in its Ruby stack, going as far as developing its own generational garbage collector for Ruby called Kiji, which, unlike the standard Ruby collector, divides objects into generations and, on most cycles, will place only the objects of a subset of generations into the initial white (condemned) set.
In 2010, however the firm announced that it was shifting some of its development focus. For the front-end the firm followed the HTML5 trend of shifting rendering code into browser-based JavaScript, and, in so doing, it ceased to gain much benefit from Rails' templating model for building web pages. Then, citing both performance and code-encapsulation as drivers, the engineering team re-wrote both its back-end message queue and tweet storage engine in Scala.
 Respecto a los clientes móviles, Rawashdeh dice: As part of our ongoing migration away from Ruby we've reconfigured the service so traffic from our mobile clients hits the Java Virtual Machine (JVM) stack, avoiding the Ruby stack altogether.

Respecto a su motor de búsqueda, también el cambio se inclinó por java: in 2011 the engineering team announced that they had replaced the Ruby on Rails front-end for search with a Java server they called Blender. This resulted in a 3x drop in search latencies.

En años anteriores se comenzó a hablar de Java como un lenguaje legacy, y de su toma por parte de Oracle, como su sentencia de muerte. Sin embargo, ha corrido agua, y la muerte no se produce: Java 7 en marcha, y preparativos para Java 8. En mi experiencia personal, con un uso más extenso de Java, observo estabilidad, confiabilidad, y buena performace. Cada vez que he tenido problemas con la JVM se ha debido a fallos en la preparación de funciones, y he podido contar con buena ayuda de la  consola de java en primer lugar, y de la documentación y la buena capacidad de manejo de errores. Tanto como soporte servidor, como en funciones cliente, la respuesta ha sido normal. Como máquina servidora para aplicaciones web basados en HTML + Javascript, su servicio es transparente y robusto. Y esto, sin contar con su ubicuidad: en cierto modo, "multiplataforma" en mi caso implica Java. En fin, mi experiencia es coincidente con esto dicho en InfoQ.

miércoles, agosto 29, 2012

Una presentación: Plex + Webclient

Una presentación publicada hoy por CM First, sobre PLex + Webclient. Para quienes no conocen Plex, una vista estimulante de sus posibilidades. Para quienes usan Plex y evalúan mover sus aplicaciones a nuevas arquitecturas, una idea de cómo mover aplicaciones a web + /o cloud +/o dispositivos móviles. Para quienes no conozcan Plex, es importante tener en cuenta la flexibilidad disponible en cuanto a arquitecturas.

En mi caso, este mes, testeando Plex + Android. Quizá agregue algunas líneas sobre sus resultados.

lunes, marzo 19, 2012

Plex 7.0 disponible

Desde hace unos pocos días está disponible la versión 7.0 de Plex, con buenas novedades especialmente para la variante .NET, soporte de Azure, servicios web, java/JEE (pensado para java 7), y el uso incrementado del API de Plex. Un aspecto que especialmente valoro es que su aparición mantiene un ciclo relativamente corto de actualizaciones.
La persistencia en el trabajo sobre el API del modelo facilita además la labor de partners, que pueden crear extensiones con mayor control sobre el modelo. Podemos decir que Plex sumado a las extensiones que explotan el API abierto, permiten cubrir ampliamente las plataformas existentes y las emergentes. En particular, estoy esperando en algunos días ver el primer ensayo sobre Windows 8 Metro, la ejecución de una aplicación construída con WebClient (Plex generando Java, HTML5, JavaScript, y CSS3). Considerando la evolución de Windows 8, creo que tenemos garantizada una nueva actualización de Plex en un ciclo más corto que el anterior.
Un documento de presentación está disponible en el sitio de CA.

domingo, marzo 18, 2012

Java y Metro/WinRT

Windows 8, en su versión orientada a futuro, es Metro/WinRT. Francamente, no sé si Metro será un nuevo Vista, condenado a ser cambiado a una nueva versión tras ser descartado masivamente; sin embargo, creo que está claro que este será el nuevo sistema operativo de Microsoft, con mayores o menores parches o variaciones, después de un mayor o menor paso de tiempo. Y también está claro que el API de Win32 tiene sus años contados, que será considerado "legacy", y que no se deben esperar mejoras futuras sobre él. En estas condiciones, que creo que son irreversibles desde el punto de vista de Microsoft, WinRT debe ser considerado como el futuro del mercado Windows dependiente.
Si esta premisa es cierta, la pregunta siguiente es acerca del universo de productos, lenguajes o herramientas construídas sobre y para esta plataforma: seguramente, algunas que ya hoy han quedado obsoletas, o cambiarán radicalmente, o deberán repensar una tecnología que las suplante, como sería el caso de Flash. Otras, las más, enfrentan un camino complicado. Particularmente, en este momento pienso en Java; no sé si tendrá sentido crear una máquina virtual pensando en Metro como interfaz de usuario (tiles, pantalla táctil), que pudiera quedar a futuro como algo más asociado al usuario final, a tablets, a dispositivos móviles en general. Pero seguramente sí debe comprobarse que una máquina virtual puede ejecutarse sobre WinRT. No he visto todavía ningún pronunciamiento de Oracle ni de otros responsables del estándar, y probablemente pase algún tiempo antes de que haya alguno; habrá problemas de políticas (qué excelente momento para cerrar Windows a la competencia...), antes de resolver cómo enlazar la máquina virtual. por ahora, solo es posible encontrar algunos sencillos intentos de ejecutar java, algunos logrados, pero doy por entendido que estos casos lo han hecho sobre el escritorio (Win32). La siguiente es una pequeña lista de  casos en este sentido:
Ejecutando Java en DOS, claramente sobre Win32,
Lo mismo, en una edición temprana.
Un intento de  instalar Eclipse.
Un intento algo inadvertido, quizá sobre Metro, pero que cae hacia Win32.
Un intento con muchos problemas.

Sin embargo, lo más sustancioso está en otros casos tempranos enfocando Metro/WinRt. Particularmente uno en Google Groups (The Java Posse), discutiendo los problemas de arquitectura (aunque para nada hay que despreciar otro argumento discutido allí: "The real reason is Microsoft pathetically trying to exclude competitors and competing technologies, trying to impose HTML5 for everything"):
So it seems that Windows 8's new "Metro" user environment will make IE plugin-free. Any attempt to use plugins like Flash, Java, Silverlight or anything else, will bring the user to the "old-style" (as in  Windows 7) desktop, which will be seen as a severe experience degradation for users who prefer the new environment.

I am not as much plugin-hater as some people; in my Android smartphone, I certainly appreciate the support for Flash, for simple practical purposes - the rare website that uses some Flash and has no mobile-optimized version or native Android app. And yeah, my karma be damned but Flash works well enough  for me (admittedly on a nice hardware - Tegra2, dual-core Droid X2, rooted & debloated, Flash updated to 10.3).

Still, I love the idea of a plugin-free world, if only for the security improvement. (Including avoidance of trash like "security plugins" mandated by online banking sites...) But this is not really fair if we consider modern browsers that run plugins in separate and low-privilege processes, plus enhanced plugin technology like Google's (Pepper and NaCl / PNaCl), plus plugins for runtimes that are managed and have their own sandboxing and security mechanisms and are sufficiently well patched (candidates: Java, Flash, Silverlight - yes none of them are perfect, they all add some to the attack surface, but the ever-growing browser is already a huge attack surface, there's no single week going without new security bugs being found in every major browser so I don't think the "three big" plugins would make things significantly worse).

There's already people betting that Microsoft will have to back away and maybe, put an option to allow plugins in Metro mode even if not active by default. I know for sure, that corporations are writing new apps with things like Flash, by the thousands. Everybody complains that the corporate world is still dragging its feet with old versions of IE, remarkably the much reviled IE6; but if you think that ActiveX code for IE6 is holding back the web, this is nothing compared to how much stuff depends on Flash. A plugin-free IE10+ will be adopted in corporate world by 2020 with some optimism...

What about the applet tag? This is not part of HTML5 anymore, but it's part of previous versions even if deprecated. This should give Java applets special privileges, at least if Metro-mode-IE will support pre-HTML5 markup (and sure as hell it must, for a long time still). I'm too lazy to install the Win8 beta just to check this, would anybody report if applet [tag] works in Metro/IE? Just curious, I guess it doesn't...

Even in HTML5, there's the [object] tag which is supported and not even deprecated. Will Microsoft break the spec and declare that this feature of HTML5 is not supported in Metro mode? What about Java WebStart, maybe the deployment toolkit can be adapted to detect Metro and not depend on [object], I guess the only fundamental need is the ability to download a JNLP file and launch the associated program? Will Metro restrict such launching too? Both Oracle and Adobe are working on their Plan B for the eventual dominance of HTML5, with new tooling that convert their stuff in plain HTML5. In Oracle's case, there is hope for JavaFX 2.0 if its Web Runtime turns out to be good (it's not yet included in the public beta so I have no idea). There is no similar hope though for old-style, AWT/Swing applets or JAWS apps that will not benefit from a similar Web Runtime.

By the way, the JavaFX Web Runtime (WRT) will be a very interesting test for the claim that Javascript & HTML5 can be fast enough and powerful enough to build any application, competing at least with Java/Silverlight/Flash if not with native apps. Summarizing, the WRT will have a pure-web implementation of the JavaFX frameworks (animation, controls, graphics etc.), I guess using canvas or WebGL and Javascript; and the application code will be (perhaps partially) converted to Javascript code. So, supposing that this WRT is well designed and implemented - and that's a core part of the v2.0 reboot plan so I guess they carefully redesigned the whole thing to make the WRT possible - then if it turns out to be much less efficient than the conventional runtime, this will be strong evidence that the mantra "HTML5/Javascript is fast enough" is bullshit. Let's wait and see.

In another interesting development, Google's technologies like PNaCl and Dart can be powerful enablers for anything that generates Javascript code, from GWT to Adobe's and Oracle's  tools. Dart is supposed to be much more efficient than Javascript, and also, the Java language will probably be much
closer to Dart than it is to Javascript (less sure about AS3...); and I'm sure Oracle and Adobe can write new compilers that emit Dart code instead of Javascript code. Or even, PNaCl code. So if these Google technologies succeed, they can benefit other platforms too. We will still be able to run other browsers in Win8. 
Otra interesante apertura es la expuesta en Iced in code:
The big question now is where does JavaSE fit in all this bold re-imagining? Oracle/Sun have done a great deal of work over the past few years to get Java to work pretty well on Windows and become as natively integrated as possible, but with the re-working of Windows, Java will be confined to the “legacy” application section for the time being, and will not be able to play with the new cool kids in the “Metroverse”. I wonder what steps Oracle  is going to take to make Java still a viable product in the new Windows 8 platform, or will they simple give up and require us all to move to platform specific programming again, like C#?
y alguna acotación de lectores:
First, Oracle should under all circumstances make Java SE compatible with the new platforms like tables, macbooks and metro to keep their concept intact – OR – find a way to easily let Java SE applications run as “apps-likes” under another Java distribution made specificly to these platforms.
Second, Metro is nothing more (or less) than a simple “start-web-page”. Windows 8 is very similar to Windows 7, with program and filesystem seperated – where android and apple are more likely to melt these two things together. Therefore I doesn’t like andorid and apple as their operationsystem are defining the limitations. Some people would call that user-friendliness, I partially agree with that.
I believe that Windows 8 Metro will be an extension to their current desktop on traditional computers, but not a future replacement making the desktop legacy – and we won’t see anything like this within the next 10 years. But Windows 8 Metro will be the beginning of web and computers melting together – and this will eventually make the desktop computer look more like a tablet – and a tablet will look more like a desktop computer – and that will happen!
Uno de los casos que chocaron con WinRT.
Una discusión que refiere a Intel y ARM.

En fin, faltando una respuesta oficial de Oracle, comienza a abrirse el juego. ¿Va usted sopesando el impacto de Windows 8 en sus inversiones en licencias, plataformas, aplicaciones?

martes, diciembre 20, 2011

Brian W. Kernighan y Rob Pike sobre depuración

Leído en Apache, a de propósito Log4j,   en la introducción:
[Tomado de Brian W. Kernighan y Rob Pike de su libro "The Practice of Programming"]
As personal choice, we tend not to use debuggers beyond getting a stack trace or the value of a variable or two. One reason is that it is easy to get lost in details of complicated data structures and control flow; we find stepping through a program less productive than thinking harder and adding output statements and self-checking code at critical places. Clicking over statements takes longer than scanning the output of judiciously-placed displays. It takes less time to decide where to put print statements than to single-step to the critical section of code, even assuming we know where that is. More important, debugging statements stay with the program; debugging sessions are transient.

martes, octubre 25, 2011

A propósito de la década de Eclipse

Jean Bezivin comparte hoy en Google+ una nota de Ian Skerrett, de la Fundación Eclipse, que puntualiza algunos de sus logros en diez años de existencia. En lo esencial:

As I have written, Eclipse is celebrating 10 years of open source and community during the month of November.   There have been a number of milestones that have shaped the Eclipse community but what have been the major accomplishments?  What has Eclipse done to actually change the software industry?  Here are what I see as some of the key accomplishments for Eclipse.
1.  Dominant Java IDE.  Eclipse started out as being a really great Java IDE and continues today to be the market leader for Java IDEs.  If you think back to the late 1990′s and early 2000′s the Java IDE market was a dog-fight between Borland JBuilder, Visual Cafe, IBM VisualAge for Java.   Eclipse is now the clear leader and has approximately 65% market share in the Java IDE market.
2. De-facto Solution for C/C++ Tools.  If you are building a tooling solution for C/C++ developers there is a very good chance you are using Eclipse CDT as the platform.   In the realtime operating system and embedded development market, Eclipse CDT has become the de-facto standard.  There at least 50 companies that are building their developer tools solution based on CDT.
3. A large and innovative modeling community.  I am not sure how to quantify it but I believe the Eclipse modeling community has grown to become one of the largest and innovative communities at Eclipse.  If you are doing modeling, chances are you are using Eclipse Modeling Framework (EMF).  However, EMF is just the core that has created a really amazing community of innovation and diversity that happens at Eclipse Modeling.   There are over 70 modeling projects at Eclipse and I know a lot more not hosted at Eclipse.   It is a great success.
4. Integrating ALM Tools.  The Mylyn project has grown into becoming the industry hub for integrating tools across the application lifecycle.   There are now over 70 different Mylyn connectors that integrate different projects into the developer desktop.
5. Modular runtimes.  Equinox and the EclipseRT projects demonstrate how modularity can work on a large scale.  Everything at Eclipse is based on Equinox, since it is the OSGi runtime.  However, Equinox and the EclipseRT top-level project has spawned an industry around Eclipse RCP and server-side OSGi.  The range of applications being built on RCP is impressive, including NASA Mars Rover, financial institutions, aircraft design, genome decoding, etc, etc.   On the server side, Equinox is used by most enterprise Java application servers and Virgo is emerging as a new Equinox based platform.
6. Eclipse Release Train.  The Eclipse release trains have demonstrated open source communities can be predictable and scale to large distributed teams.   This is incredibly important as large more conservative companies become involved in open source.  Very few other organizations can claim a track record of predictability and scale that compares to the Eclipse community.
7. Eclipse Ecosystem.  Eclipse has become one of the two major development tools platform in the industry; MS Visual Studio being the other.   No matter what language you are using there is most likely an Eclipse IDE for you.  No matter what developer tool you are using, there is probably an Eclipse plugin.   No other platform has been able to create such a diverse and large ecosystem.  It has actually made building and integrating developer tools a lot easier!
De esto algo conocemos en la comunidad de Plex: al menos dos emprendimientos vinculan extensiones de Plex con las posibilidades de Eclipse: Webclient, creando una variante web ajax a partir de la generación de código Plex java, y el trabajo de Christopher Smith, mejorando el proceso de implementación de un modelo Plex. Dos sugerencias que abren un panorama más que positivo para el futuro.

domingo, octubre 16, 2011

Una opinión sobre el valor de Java

En el curso de una discusión sobre Dart en Google+, Rafael Chaves da una interesante visión sobre Java:
"Java was not innovative at the time, and did kill many OO languages initiatives"

I am not sure Java killed other initiatives - I feel more like they were dead on arrival, at least from a market suitability PoV.

The non-technical aspects are just as important as technical merits. It does not matter how cool a language is, if it is not going to be supported by multiple vendors/platforms, if it evolves in a way that invalidates previous investments, if it is hard to learn for the average developer, if doesn't have proper support for a wide variety of application styles/domains, if is going to be hard to hire people. Getting that right is as critical as (or even more than) technical benefits.

Java got all those right, and that is why it succeeded. I don't think it is a lot about money. Sun could have poured twice as much money into it, but if they failed to recognize the importance of those aspects, it would have been a flop, or have limited success (see Microsoft .Net). But these days I wouldn't bet against similar success being attainable by an open source foundation with a strong community, without nearly the same level of financial backing, if they aimed for building for the mainstream and the long term like Sun did with Java.

As a developer, I want my investment in learning my next language to pay off for as long and across as many domains and technical architectures as possible. That is much more important than having the perfect feature set.
...y a propósito del valor de Dart, Angel "Java" López ha abierto una línea de discusión e información.

domingo, abril 10, 2011

Lenguajes de programación y rankings

Reviendo dos rankings de lenguajes de programación: Tiobe y The Transparent Language Popularity Index, éste último, en Source Forge (apuntado por Jean Bezivin). Coincidencias básicas entre ambos para los primeros puestos: con leves diferencias, Java, C, C++, PHP, C#. En ambos rankings, no se habla de número de aplicaciones, líneas de código, ponderación de la importancia de las aplicaciones involucradas. Fundamentalemnte, lo que establece su importancia es la popularidad del lenguaje. La fórmula de Tiobe lo explica:
The ratings are calculated by counting hits of the most popular search engines. The search query that is used is
+" programming"
This search query is executed for the top 6 websites of Alexa that meet the following conditions:
  • The entry page of the site contains a search facility
  • The result of querying the site contains an indication of the number of page hits
Based on these criteria currently Google (32%), YouTube (10%), Yahoo! (3%), Bing (3%), Wikipedia (16%), Blogger (32%) and Baidu (3%) are used as search engines. The number of hits determine the ratings of a language. The counted hits are normalized for each search engine for the first 50 languages. In other words, the first 50 languages together have a score of 100%. Let's define "hits50(SE)" as the sum of the number of hits for the first 50 languages for search engine SE and "hits(PL,SE)" as the number of hits for programming language PL for search engine SE. Possible false positives for a query are already filtered out in the definition of "hits(PL,SE)". This is done by using a manually determined confidence factor per query. A query such as "Basic programming" also returns pages that contain "Improve your basic programming skills in Java". The first 100 pages per search engine are checked for possible false positives and this is used to define the confidence factor. If this factor is 90%, then only 90% of the hits are used for "hits(PL,SE)". An overview of the confidence factor can be found in the groupings table below.
The ratings are calculated with the following formula:
((hits(PL,SE1)/hits50(SE1) + ... + hits(PL,SEn)/hits50(SEn))/n
where n is the number of search engines used.
¿Son importantes estos índices? La popularidad implica que han ocupado la atención pública, que fue analizado para su adopción, que distintas comunidades recurrieron a consultas para resolver problemas o educarse, en fin, que estuvieron en el foco de la atención de la comunidad de la industria. Pero no habla en todo caso de los consolidados, aquellos que se usan sin ruido, y que pueden ser usados también en abundancia, como sin duda sucede con COBOL, RPG y otros.
En el último tiempo, suele hablarse de Java como un lenguaje "corporativo", igualándolo a "legacy". Su continuidad en la primera línea en todo caso muestra que su interés no se ha amortiguado.

sábado, noviembre 06, 2010

Nuevas reflexiones sobre el software futuro

La semana pasada hubo un gran revuelo en la comunidad de usuarios de Silverlight. En su PDC2010 (Professional Developers Conference 2010, finales de octubre), Bob Muglia y Steve Ballmer hicieron comentarios que indujeron a pensar a distintos observadores que Silverlight pasaba a una vía muerta. Mary Jo Foley publicó un artículo que corrió como la pólvora, y desató toda clase de especulaciones que todavía duran. Aunque el tema de por sí es muy interesante, en este caso deberá quedar para otra oportunidad. Está por verse si realmente Siverlight pasa a mejor vida, o el revuelo proviene de un torpe manejo de relaciones públicas (dicho sea de paso, el post del blog de Siverlight que acompañó al anuncio, y que se convirtió en un muro de los lamentos, todavía no ha tenido una respuesta clara y definitiva de parte de sus autores, a cinco días de emitido). En fin, lo que particularmente me atrajo en este caso, fue el tipo de discusión que generó: una vivísima representación del estado de la construcción del software en ésta época. Lo que sigue es una lista de asuntos de primera importancia que fueron discutidos. Todos los comentarios siguientes son respuestas al post de Bob Muglia en el sitio de Silverlight. Al fin de cada párrafo se indica el nom de guerre que cada usuario prefirió usar. Hay mucho más material en otros sitios que generaron respuestas, otros interesados con blog propio, comentarios de periodistas de tecnología, etc. Quizá más adelante se agregue algo de esto.

Múltiples dispositivos y plataformas, no más un ambiente cerrado y confortable
Uno de los temas de mayor preocupación reflejados es el de la cobertura del producto respecto de dispositivos crecientemente heterogéneos, no sólo escritorio: mientras sus seguidores esperarían la ampliación de Silverlight "al menos" a Android, si algo dejan claro, es que para el producto, sólo hay planes para Windows Phone 7. Claramente, el mundo ha devenido heterogéneo y no monoproducto:
I'm in a project where we have to make a decision between Silverlight and HTML5. We were leaning toward Silverlight, but then put the brakes on when we heard about the comments from the PDC. This blog post doesn't help Silverlight's case. It merely looks like you're trying to calm a panic. But the reality is that anyone deciding on Silverlight vs HTML5 for new applications, that will be supported years down the road, must seriously consider jumping into HTML5 as the safer path. Clearly you've admitted it's the best path for cross platform applications. In an iPad, Android, Windows and everything else world we are flying toward... how can we *not* pick HTML5. (Dave Friedel)

To rectify this, I need to see an announcement that Silverlight will be ported to Android. Flash has. Yes, an iPhone port won't happen bc Apple policy, but Android is shipping on more phones and is more likely to be used by business people than iPhone. WP7 is starting from too small a base to invest in significant development. Right now develop for iPhone bc it's got the buzz, Android bc it's got the momentum, and then WP7 if and when resources allow. An Android port of Silverlight means develop for Android/WP7 first which further deflates iPhone momentum. Think strategically. (Anónimo)


I understand that porting it to iPhone is beyond Microsoft's reach and depends primarily on Apple , but it would be nice to get it ported to Android. No one expects you guys to cover all of the platforms with SL, but it would be nice to cover the most popular ones.(Nick Polyak)


Your competitior isn't backing away from taking its technology to popular platforms - they're finding ways to reward developers and designers for their continued support and loyalty by making sure they have a path to run everywhere that's relevant. There's no questioning their commitment, and yet questions persist about yours. (Anónimo)

Basically you're saying that it's not a battle you want to fight, so you're giving up altogether. I don't think everyone expected Silverlight to be on every device. Heck, the top 10 would be more than enough to satisfy nearly everyone out there (including devices your company controls and owns, such as Windows, Zune/WP7 and XBox).
HTML5 certainly hasn't had a problem with adoption on several devices. Heck, even Android (an entire OS) hasn't. So why is Silverlight having such a challenge in doing it? (Daniel)


I've been building a website over the past 2 years that incorporates 20,000+ lines of Silverlight on the client side (and yes, it really does need to be that complex.). I've been completely trusting Microsoft's commitment to this platform, but I'm now very very worried indeed. I've just spent all weekend learning GWT, and I'm starting to think a port might actually be plausible. Bob's blog post really seems nothing more than a half-assed effort at damage control, and I'm afraid that where there's smoke there's probably fire.
This time last week, I was silverlight's greatest fan. But unless you do a *lot* more to restore my confidence, I'm planning to spend the next month seeing how far I can get in migrating to GWT. I can't quite understand why you think this is a good thing for Microsoft. (ArcMan)
I'd like to see Silverlight and the Metro UI phone/tablet interface integrated tightly into Windows 8 the way iOS is being integrated into OSX Lion.
Microsoft should utilize Windows Phone 7 and the Silverlight implementation to create an install base of developers who can then populate a mobile, desktop, tablet, and web app store. It only makes sense then to include license options for apps that run across the different mediums the Silverlight can hit.
I think anyone who doesn't see Silverlight as an LOB/media tool is missing the boat. I would never build a website in Silverlight. I would build my media viewer or my backend system though. I would definitely build an app on Silverlight. (CKLuis)


" As a result, getting a single runtime implementation installed on every potential device is practically impossible. " [conceptos de Bob Muglia en su post]
It's absolutely possible, and moreover that's exactly what must be done. You can have platform specific extensions of course, but core must be the same for all platforms. And if you cannot implement SilverLight runtime for all possible devices, just open source it, and it will be ported to any "potential" device in few months, and we won't need to even listen this meaningless statements how "cool" HTML5 is. (Sipank)
As a .NET/XAML programmer I've been very disappointed that I can't target one of Microsoft's popular platforms, the XBOX 360. It has been difficult to understand this glaring omission, but Scott Barnes' explanation as to the internal unpopularity of WPF sure seemed to make a lot of sense. For the immediate future, say the next five years, these are the relevant platforms...
Windows
Mac
iPhone
Droid
WP7
XBOX
Playstation
You're already on three of the seven. After watching you guys for years supporting NT on x86, Alpha, and x64, you can't convince me that you can't easily port a 5MB runtime to four more platforms. The tools and silverlight groups have done AMAZING work, to "shift" strategies now would truly be grabbing defeat from the jaws of victory. I imagine your partners like Netflix would be delighted if they never had to do another port again and could rely on Silverlight. Seriously, if Sun and their grotesquely incompetent programmers were able to port java to so many platforms, you guys should at least be able to get it on seven. (Jack Bond)
I see silverlight as a better and lighter version of desktop runtime in replacing wpf which is so heavy and hard to deploy to people who don't have the latest runtime.
I found that even without html 5, the current javascript + html4 + css enable people to build much prettier and user friendly UI. Silverlight follows a desktop UI philosophy and doesn't really fit into the browser except some case of advertising oriented banner... (collaboration cloud)

Do what should have been done in the first place - make Silverlight compile down to a html5 compliant web application. You know, sorta like how GWT does it. Write java, get all the benefits of it, but it produces minimized, best practice compiled javascript.
I think MS took the fight against 'Flex', and by the time it was ready, realized they missed the train because Apple and Google are attacking the web pieces, meanwhile MS went backwards and is now sitting in the same 'yucky' spot as Adobe.
Making browser plugin's is yesterday's technology.
Actually, what is odd, is that the MS team used Script# to build the online Office - not Silverlight - that alone should tell you the status of Silverlight. Wake up people. MS should be investing in Script#, not Silverlight. (Steve)


The community will definetly like to see silverlight ported to more platforms. How commited are you to making silverlight cross platform? (Arson)

When you buy a PC or a car, you own it. You are free to use it the way you like and you can install any extension/software you want without asking the manufacturer. The mobile phone market is different. Think of it as a car you paid for in cash, however every year you have to pay a license fee and for every drive you have to pay-per-use for the steering wheel. Not to mention the payment for the manufacturer's OK for 3rd party tires... This is exactly the Apple business model for the iPad/iPhone. You buy it, yet Apple owns it/controls its usage.
Now Microsoft obviously failed in coming up with a similar or competing business model. Option a) entering the hardware market, controlling the devices, with full power offends all hardware partners and option b) controlling the application market through a license check in the SL runtime fails, because Silverlight (legally) cannot be installed at the majority of mobile devices.
(...)
So dear fellow developers, this is not about SL, this is about losing the first big battle on the mobile phone operating theatre. We're the collateral damage.
Microsoft has enough cash for scraping another phone platform; happened early this summer didn't it? However what about you and me?
And I hope: Microsoft buys Nokia. (Hidden War)
Los lenguajes y arquitecturas propietarias son un escollo
Un tema que subyace en la preocupación de varios de los reclamantes, es la necesidad (aceptada o no, da lo mismo en este caso) de adaptarse a estándares concertados, dado que "el mundo es ancho y ajeno":
What we have here is a fundamental conflict between the desire for standards (although how anyone can call HTML a standard is beyond me since even simple stuff renders differently in different browsers) versus the desire for productivity. Given enough time, resources, and patience, you could create and maintain just about any piece of software using just about any environment and tools. However, creating increasingly complex RIAs with the brain dead HTML/CSS/Javascript/4 million libraries stack strains the time constraints and resource that companies have and exceeds the patience of professional developers used to working with even modestly productive development environments. Silverlight should be more correctly call Silverbullet because it massively overdelivers on the productivity and capability needed to create RIAs. If standards are a problem, why not just turn the future definition Silverlight over to a standards body like Netscape did with Javascript and whoever did with HTML? Then the standards people would have their objections undercut and those of us who actually do development could get on with our work. (Bryan Morris)


Perhaps MS should consider releasing a lightweight SL runtime for low power handheld devices. This make great sense, because these small screen interfaces normally use fancy animations with just a minimal input control set, and a lightweight runtime would allow MS to easily port SL to a large number of low power devices.
The apparent problem now is that SL is rather weighted with features -- many of which are appropriate only in larger screen environs, and this limits the potential device audience. This is likely why WP7 required a more robust engine. Perhaps a simple solution would be to offer WP7 with the full runtime, but publish lightweight runtimes for the rest of the mobile universe. This would give WP7 a control set edge, and at the same time, would allow most (efficiently coded) apps to cover the bulk of the device universe.
The iPhone and other market-significant proprietary boxes will quite likely be pressed by market forces or lawsuits into support other runtimes, such as Flash and SL. A lightweight runtime option makes SL more palatable to these vendors, since they wish to protect product performance perceptions, but at the same, wish to enjoy revenues from app sales. (Handled device suggestion)


Silverlight is not and never will be the one tool to use for all situations but it continues to be a very useful tool for many situations.
I'm typing this on a iPad and so I cant use many of my own Silverlight apps in the same way that Flash isn't available to me.
After lunch I'll go back to my desk and continue to work on my current Silverlight project which is the best tool for that particular project and environment with some support software being written in MVC2 for the web.

To get angry for being told Silverlight won't run on iPads and some other environments is madness, we already know this. If you want to hit every environment, use an open standard like H5 and accept the limitations that come with it. Judge on a project by project basis. (kaseciu pildymas)


I understand your point and your choice of client side technology is the most reasonable choice given the platforms you are targetting. However that does change nothing about Javascript not being suitable for complex client application development. I believe that the main reason for the choice has nothing to do with Javascript qualities as a language and development technology rather than the simple fact that Javascript is available on all those platforms and Silverlight is not. And I believe you would seriously consider Silverlight or other technology based on statically typed language, full cross-browser and cross-platform compatibility etc. if it was supported on all those platforms.
My understanding of Microsoft's message is "we are not able to put Silverlight on every platform so we are moving to HTML5/Javascript". And my fear is that it will slow down and with time maybe even stop Silverlight development and expansion because Microsoft "already has a strategy to get you everywhere" so why invest to Silverlight. Or at very least "why invest to Silverlight in a pace like last years", which is also disappointing.
HTML5 is a must have, there is no doubt about it, but it should not affect Silverlight in any way. (Martin)


I am not sure why so many people blame Microsoft for their commitment to Silverlight. It was quite clear from the beginning that Silverlight will be only available for Windows platform. I don't think this decision changed to much. If you stick with Widows platform you will be fine in any case. If you wanted to have a cross platform solution Silverlight was never a good choose or did some of you naively think that it will be ported to other platforms? (Aleximo)


I commited our development team and reputation to Silverlight. And now I have been left high and dry ! I am not really convinced by this Blog Post. The message is out there, Microsoft is adopting HTML5 in preference to developing Silverlight further. Microsoft are just going to let Silverlight die, after a couple more weak releases. Shopw me the Silverlight Roadmap for the next 5 years, on the Main Microsoft.com page, and maybe you will convince the Developer and their bosses that we have all not just adopted a turky technology.
I should have learn't from the J++ experiment.
I will never trust MS again. (No longer trust Microsoft)
I think some of you are missing the big picture. Whether or not Silverlight's direction has "shifted" or whether or not HTML5 is a full replacement is tangential at best to the point Bob made in his original quote.
Many of you have been saying Silverlight is "cross platform". If we were in the 90s, this would be right, it covers multiple browsers on the two largest operating systems.
Bob's comments are simple: web development is not about cross browsers, and it's definitely not about two operating systems. The ecosystem of web applications on a broad scale is widening greatly to include many new OSes, hardware types, form factors, screen sizes, hell even bandwidth assumptions are up in the air at this point.
If you wanted a "cross platform" web site or web application, Silverlight isn't and never was the right answer. The only difference between last week and this week is that Bob pointed out that it is infeasible to port Silverlight to all of these devices, form factors, and platforms. That should have been obvious to anyone knowledgable enough to be on this thread; him saying it is just a rubber stamp on something intuitively true.
This was true last week and it'll be true next week: If you're trying to come up with a desktop application that is loaded through a web interface, and you're okay with only supporting two operating systems, Silverlight will give you some nice bells and whistles for grander application. However, if you're looking to make a truly cross platform web solution, you need to be using HTML and its related standards and technologies. (ChrisC)
El panorama está dado...Hay otros elementos de gran interés, que en todo caso, irán en otro momento. Por ahora es suficiente. Un común denominador entre tantos desarrolladores del ecosistema de productos de Microsoft, es la nula referencia entre todos ellos a herramientas de desarrollo basado en modelos, o al menos, referencias a lenguajes específicos de dominio,  a pesar que durante dos años el tema fue un caballo de batalla de Microsoft. Sin embargo, en el fárrago de lenguajes y arquitecturas, éste debiera ser el punto que les diera perspectiva y tranquilidad ante abruptos cambios de frente o apariciones de nuevas arquitecturas. Un elemento general es el sentido de decepción y vacío, frente a la inversión de horas y dinero, cuando el dueño de un producto los deja solos y sin respuesta. Una estrategia no recomendable, existiendo la alternativa del desarrollo basado en modelos, en el sabor que se desee.