932
I Use This!
Activity Not Available

News

Analyzed 4 months ago. based on code collected over 4 years ago.
Posted about 6 years ago
In this screencast a script is dynamically loaded by user action (with click on a button) and without any external libraries: Dynamic script loading is particularly useful for polyfills, which can be conditionally loaded depending on browser's ... [More] capabilities. See you at Single Page Applications (SPAs) -- the "no frameworks, no migrations" approach, at Munich Airport, Terminal 2 or webstandards.training (online). Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
JSON-P (JSR-374) from Java EE 8 comes with JSON Patch support, which can be used for manipulation (patching) of JsonObject instances (see also Java EE 8 and JSON-P Simplify System Testing with JSON Patch): @Test public void patch() { ... [More] JsonObject sub = Json.createObjectBuilder(). add("name", "EE4J"). build(); JsonObject initial = Json.createObjectBuilder(). add("fact", "Java EE is nice"). add("myth", "Java EE is heavyweight"). add("future", sub). build(); JsonPatch patch = Json.createPatchBuilder(). add("/version", "8"). replace("/fact", "Java EE rocks"). replace("/future/name", "Jakarta EE"). remove("/myth"). build(); JsonObject result = patch.apply(initial); System.out.println("result = " + result); } Output: result = {"fact":"Java EE rocks","future":{"name":"Jakarta EE"},"version":"8"} JSON-P comes as a single maven dependency: org.glassfish javax.json 1.1.2 See you at Java EE Workshops at MUC Airport, particularly at the Effective Java EE 8 workshop Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
Bastian, please introduce yourself (feel free to share your twitter, linkedin, github etc. accounts) My name is Bastian Sperrhacke and I am a software developer and technical lead in a ten people team called "Verfügbarkeit" (availability) at Otto ... [More] GmbH & Co. KG. There are three business analysts, six developers (including me) and one teamlead responsible for the product availability calculation and the product sell services. We are one of many teams in the backend IT of Otto. You can find me at @deratzmann and Bastian Sperrhacke. What are you building with Java EE? We build our latest system for additional sell services for products offered in a shop with Java EE 7. For example, if you want to add an additional warranty to your mobile phone or want to get rid of your old washing machine while receiving the new one, there is a business case called "article service" which abstracts these kind of cases. We build this system as a Java EE microservice and offer REST Services for our frontends and shops. Can you share with us some geeky numbers like e.g. TX per seconds, heap sizes, thinnest WARs etc -- whatever Java EE devs might find interesting. Currently our WAR file is about 300kb, the biggest file inside is our swagger documentation file (71kb). From commit to production we are live in about 7 minutes with our continuous delivery pipeline, including Unit-, Integration-, System- and Performancetests. Our software is running since begin of February 2018 and had 5280823 requests in the last week. Are you happy with Java EE so far? Is Java EE productive? Yes, I am very happy with Java EE. It provides me a standardized way to code, is well documented and highly used. With Java EE you can become productive in minutes, no bloated configuration or dependency hell anywhere. Just code your business requirements. Which application servers, tools or IDEs are you using? First of all we use the Payara full server, it is very fast and productive, well documented. It provides the stable Java EE API and the innovative, fast moving microprofile. The Payara team is very nice, I got to know them at JavaOne last year. Relating IDEs it is up to each team member to use his favorite IDE or editor. Most of us (including me) are using netbeans, very nice, fast and lean IDE. For our pipeline we use Jenkins. Our docker containers are orchestrated by docker swarm. You are using the Boundary Control Entity pattern to structure your applications. What were your experiences, challenges and findings so far? The first big challenge was to structure the class and the packages in a business, not a technical driven way. So no more "persistence", "valueobjects" or "service" package. For decades developers learned to structure in a technical way. But for new guys in a team it is hard, to find a business case implementation in such a structure. The ECB pattern is the easiest way to fit in that context. You start with an entity and a service called boundary. There is no easier way. And if (and only if) the boundary "gets too big", you refactor the non-standalone functions out to a so called control. In my opinion this way leads to a clearly arranged code, not overengineered, just fitted to the current required business case. How important are standards for you? Does your application depend on application server specific APIs? Standards are very important for me. When you are professionally developing products, you have to ask yourself: Do I technically need an early adopter software or a long lasting lean product. In real world projects the truth lies between these two approaches. And Java EE is a perfect fit for that. First you get a quite stable API, which is continuously evolving. Since Java EE was transferred from Oracle to the community, I think there will be much more drive behind it. Let's have a look at the great companies standing behind the microprofile initiative. This initiative is also responsible for a quite innovative de facto standardization. Using one of the application servers like Payara means, I get the API stability of Java EE and a fast evolving feature set of the microprofile. In our project we currently use the microprofile-config-api and plan to use the new fault-tolerance-api. Furthermore we use some Payara specific implementations like the Jackson API. We also planned to use the build-in Hazelcast for distributed job scheduling and caching. Which Java EE APIs are you using in your products? Generally we use EJB, JPA, CDI, Bean Validation, Jax-RS, JTA and JSF. You attended JavaOne last year. What was your impression? This was my first time at JavaOne and also my first time in the US. It was amazing and I hope to get a chance for a second visit in the near future. I attended as much sessions as I could get. It was exhausting but worth it. Hopefully I can introduce some ideas in our daily business. Can you share any resources (blogs, etc feel free to promote yourself) with us? I get my newest info from twitter. I read tweets and blogs from Vlad Mihalcea, Thorben Janssen (hellish good JPA specialists), Sebastian Daschner (Java EE evangelist), Payara (Java EE Server) and last but not least Adam Bien. :) Bastian, thank you for the interview! Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
JSON-P (JSR-374) from Java EE 8 comes with JSON Patch support, which is useful for system testing. A JSON object returned from a HTTP endpoint can be easily compared to a local representation loaded from a file: import javax.json.Json; ... [More] import javax.json.JsonObject; import javax.json.JsonPatch; import javax.json.JsonReader; import static org.junit.Assert.assertTrue; import org.junit.Test; public class JSONPDiffTest { @Test public void subtraction() { //e.g. server result JsonObject actual = Json.createObjectBuilder(). add("a", 21). add("b", 1). build(); try (JsonReader reader = Json.createReader(this.getClass().getResourceAsStream("/expected.json"))) { JsonObject expected = reader.readObject(); JsonPatch diff = Json.createDiff(expected, actual); assertTrue(diff.toString(), diff.toJsonArray().isEmpty()); } } } The code above loads the file src/test/resources/expected.json with the content: { "a": 21, "b": 2 } and compares it to the actual instance. The result is: java.lang.AssertionError: [{"op":"replace","path":"/b","value":1}] JSON-P comes as a single maven dependency: org.glassfish javax.json 1.1.2 See you at Java EE Workshops at MUC Airport, particularly at the Java EE CI/CD, Testing and Quality workshop Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
My company NetBeans RCA is based on Apache Ant, Ant is a build tool for Java that was very popular when I started programming and many IDE used it to build. The NetBeans platform build system was totally based on Ant and this was very good because it ... [More] allowed customizing the build process. We are currently using it to generate files to be included in the NBMs (the NetBeans Module), to update version numbers, to copy files, to upload files to our server … Unfortunately, nowadays Ant lost popularity to Maven and Gradle which allows also to automatically download the necessary libraries, however, we have some many stuff built in Ant and we became experts at using it that it is not worth moving to Maven, that is currently also supported by the NetBeans Platform. For those like me that are still using Ant, I would like to share some tips. Install the Important Files plugin If you create a new Java Application project (Not Maven) in NetBeans, the project is based on Ant, but you do not see its build script file unless you press CTRL+2 and search in the Files window. But, when you create a NetBeans Module project you get an Important Files node that shows all the configuration files used to build that module. You can have the same node if you install a plugin called ImportantFiles 4 JavaSE. It will add a node with the build script and the properties files used to configure the module. The build file will be listed as Build Script, Buildscript or build.xml . How to launch easily  any Ant targets Once you got access to the build file, if you expand it you will see the list of all available targets, you can run them by right-clicking on them and selecting Run Target. From this menu, you can also debug and inspect the targets by choosing Properties. The coolest feature is Create Shortcut… This action will create an item on the toolbar, on the menu or a keyboard shortcut to launch the task, it will only be visible when the project is open. I find it very convenient when I am working with my custom Ant targets that  I have to run often. Another way to run an Ant Target is to right click on the build script node, choose Run Target and then the target you want to run. If the target you want to run is not present you might have to expand the Other Targets submenu. At the beginning, I was lost about why some targets appear at other targets and others don’t, then  I discovered it works like the -p Ant command line option: it lists only the targets that have a description. To add a description to a target, just add a description attribute with some text in it.   How to customize the build process When you open the build file there is a huge comment that explains how to customize the build process, in particular, it explains how to launch your own targets before or after any step in the build process.For instance, there are these two examples: one to add obfuscation after the build:   another to override the execution to launch your own executable Hint for NetBeans Platform developers:  how to run the same target on all modules It happened to me that I had to run the same target on all my modules in a suite. You can do it in this way: Create a new Target that depends from -init and use subant  Photo by Mikhail Vasilyev on Unsplash [Less]
Posted about 6 years ago
In this screencast I implement and use a Mixin with stock JavaScript / ES2015 (ES6): "In object-oriented programming languages, a Mixin is a class that contains methods for use by other classes without having to be the parent class of those other ... [More] classes (...)": See you at Single Page Applications (SPAs) -- the "no frameworks, no migrations" approach, at Munich Airport, Terminal 2 or webstandards.training (online). Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
Questions and topics for the 47th airhacks.tv -- a monthly Questions and Answers show: Database Authentication: SSH vs. username / password Microservices with JSF frontend -- architectural discussion How to modularize WARs Dealing with denormalized ... [More] databases Java EE authentication (Active Directory) Identity preservation and audits in DB JAX-RS authentication and principal delegation to EJB / CDI Development in intranet environment Reducing coupling between Javascript components like e.g. in React Developers and operations -- their roles in the future DeltaSpike project review -- with or without @Repository Impact of 3rd party libraries on build performance -- with some numbers Unpredictable, long running transactions Propagating principals from JAX-RS to EJBs Why it is a bad idea to resend a password on each request? Dealing with security in projects like e.g. credit card processing Ask questions during the show via twitter mentioning me: http://twitter.com/AdamBien (@AdamBien) or using the hashtag: #airhacks. You can join the Q&A session live each first Monday of month, 6 P.M at airhacks.tv or http://www.ustream.tv/channel/adambien See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io. Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
WebComponents are an interesting set of browser APIs to implement entire applications from scratch. However: WebComponents were also designed for reuse, so you can easily include 3rd-party (like e.g. Vaadin) components with your application. In ... [More] this screencast I'm integrating a Vaadin Date Picker WebComponent with plain JavaScript / ES 6. From scratch, in 6 minutes: See you at Structuring Single Page Applications (SPA)s / Progressive Web Applications (PWA)s with WebComponents -- the "no frameworks, no migrations" approach, at Munich Airport, Terminal 2 or webcomponents.training (online). Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
A smalltalk :-) with Shaun Smith, @shaunmsmith, Director of Product Management for Oracle Serverless and Fn project committer. From TopLink, EclipseLink over fnproject.io to Fn Java Functions Developer Kit (screencast), exploded application ... [More] servers, Docker and serverless architectures or the 5th episode of airhacks.fm. Subscribe to airhacks.fm podcast via: iTunes or RSS See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io. Real World Java EE Workshops [Airport Munich]> [Less]
Posted about 6 years ago
My 2018 predictions: Thin WARs become mainstream. Packaging the infrastructure together with the business logic although only <1% changes is not reasonable in containerized environments and slow. Fast turnaround cycles are crucial for ... [More] productivity. Developers infected with "Thin WAR" mindset thrive for Micro WARs with fast deployments. It is common in green field Java EE 7 projects to have WARs smaller than 1 MB. Microservices become just another solution for a problem and not a general architecture. It is perfectly fine to deploy a single, small, WAR containing everything: a macroservice / microlith. Serverless overuse: serverless architectures claim to safe costs and to simplify operations. This is not true for all use cases -- I expect first reports of failing serverless projects due additional implementation complexity and plumbing. However: combining "traditional" Thin WARs with serverless endpoints brings the best of both worlds together. Servers for the main load and functions for (infrequent) events. OpenLiberty could become the killer Java EE 8 / Java 9 application server. Small, lightweight and with interesting production features. SQL revival: Modern relational databases like e.g PostgreSQL will regain traction. JMS revival: there is a lack of popular common messaging API in microservice context. JMS 2.0 is just an API and could be implemented by many messaging services. JMS API with a "funky" implementation could (should) gain traction. I got the first requests about Java 9 modules within microservices. There should be a buzz around additional module complexity introduced with "premature modularization" in second half of 2018 (or earlier). Fat Clients are back: Service Workers, Cache API, Progressive Web (Offline) Apps, IndexedDB, "offline first" encourage developers to put more and more logic on the client. This is exactly how Fat Client is defined. The year of "UseThePlatform": more and more "enterprise" projects will move away from JavaScript frameworks to plain WebStandards. Frequent migrations are expensive and come with no additional value. Server Side Rendering (SSR): server side rendering is a viable architecture for SPAs / PWAs. Java Server Pages have a bad name, but are a fast and capable serverside templating technology with great tool support. Raise of WebComponents (v1): Custom Elements, Shadow DOM together with ES 6 are a viable alternative to JavaScript frameworks. The longer you wait, the leaner your application becomes. Frameworks known from Java ecosystem like Vaadin Elements and Prime Elements become a popular WebComponent-compatible UI widget provider. HTTP/2 and Webstandards will dramatically simplify the JavaScript build pipeline. No build is the best build. JavaScript (ES 7+) will become more and more similar to Java. Now Java developers can become easily webapp developers with 20+ years experience :-) My 2017 predictions were... Real World Java EE Workshops [Airport Munich]> [Less]