Česky   |  Deutsch   |  English   |  Español   |  Français   |  Indonesia   |  日本語   |  한글   |  Polski   |  Português (BR)   |  Türkçe   |  中文   |  正體中文   |  Your Language  
PlanetNetbeans
Planet NetBeans is an aggregation of NetBeans related musings from all over the Blogosphere.
Feeds
[RSS 1.0 Feed] [RSS 2.0 Feed]
[FOAF Subscriptions] [OPML Subscriptions]
Do you blog about NetBeans ? Add your blog to PlanetNetBeans.
Feed Subscriptions
APIDesign - Blogs (feed)
David R. Heffelfinger (feed)
Carsten Zerbst's Weblog (feed)
Winston Prakash's Weblog (feed)
DukeScript (feed)
ProNetBeans (feed)
Paulo Canedo » NetBeans English (feed)
NetBeans Ruminations » NetBeans (feed)
Anchialas' Java Blog (feed)
markiewb's blog (feed)
Need to find a title (feed)
Category: NetBeans | Software and Science (feed)
Roger Searjeant's blog (feed)
Inspiration and Expression » Netbeans (feed)
Adam Bien (feed)
Bernhard's Weblog (feed)
Michel Graciano's Weblog (feed)
Ramon.Ramos (feed)
Ozone and Programming » netbeans (feed)
Arun Gupta, Miles to go ... (feed)
Geertjan's Blog (feed)
.JARa's Bilingual Weblog (feed)
JavaFX Composer (feed)
The Java Jungle (feed)
Jesse Glick (feed)
Martin Grebac (feed)
The NetBeans Community Podcast (feed)
NetBeans Profiler (feed)
NetBeans for PHP (feed)
NetBeans Web Client (feed)
Rechtacek's (feed)
Virtual Steve (feed)
The Aquarium (feed)
Tinuola Awopetu (feed)
Insert Witty Irony Here (feed)
Netbeans – Gualtiero Testa (feed)
netbeans – James Selvakumar’s Blog (feed)
NetBeans – nB gUru (feed)
netbeans – Newsintegrator Blog (feed)
NetBeans – Praxis LIVE (feed)
NetBeans – TechAshram (feed)
Netbeans – There's no place like 127.0.0.1 (feed)
Anuradha (feed)
Netbeans6/6.5 my best practices (feed)
Java Evangelist John Yeary (feed)
Neil's Dev Stuff (feed)
Computer says null; (feed)
NetBeans Adventures, Java and more (feed)
NetBeans – John O'Conner (feed)
NetBeans Community Docs Blog (feed)
The Netbeans Experience (feed)
NbPython/ jpydbg / pymvs (feed)
Shanbag's Blog (ರಜತ ಲೋಕ) (feed)
Wade Chandler's Programming Blog (feed)
Devlin's Lab (feed)
Big Al's Blog (feed)
Code Snakes (feed)
In perfect (spherical) shape (feed)
Van Couvering Is Not a Verb (feed)
Diego Torres Milano's blog (feed)
Vroom Framework (feed)
Messages from mrhaki (feed)
Jeff's Blog (feed)
Manikantan's Netbeans (feed)
Oliver Wahlen's Blog (feed)
Shuttle between Galaxies (feed)
Welcome to my live... (feed)
Devel Blog (feed)
diamond-powder (feed)
Antonio's blog (feed)
Where's my Blog?!

Powered by:    Planet

Last updated:
September 26, 2016 06:06 AM
All times are UTC

Sponsored by
sponsored by Oracle

visit NetBeans website
Adam Bien - September 25, 2016 05:37 AM
The Ingredients and Roadmap of Rebooted Java EE 8 and 9

After one year vacations Java EE 8 was rebooted and is going to be optimised to run on hypervisors and / or container environments. Java EE 8 will focus on the following areas below -- it is a proposal and very likely to change in the JCP process:

Programming Model
  1. Extend for reactive programming
  2. Unified event model
  3. Event messaging API
  4. JAX-RS, HTTP/2, Lambda, JSON-B, (...)
Packaging
  1. Package applications, runtimes into services
  2. Standalone immutable executable binary
  3. Multi-artifact archives
Key Value/Doc Store
  1. Persistence and query interface for key value and document DB
Eventual Consistency
  1. Automatically event out changes to observed data structures
Serverless
  1. New spec - interfaces, packaging format, manifest
  2. Ephemeral instantiation
Configuration
  1. Externalize configuration
  2. Unified API for accessing configuration
Multitenancy
  1. Increased density
  2. Tenant-aware routing and deployment
State
  1. API to store externalized state
Resiliency
  1. Extension to support client-side circuit breakers
  2. Resilient commands
  3. Standardize on client-side format for reporting health
Security
  1. Secret management
  2. OAuth
  3. OpenID

The choices are pragmatic and will make Java EE an even more productive platform. I'm only missing a slightly extended and modernized "Concurrency Utilities for Java EE" (jcp.org/ja/jsr/detail?id=236). Particularly the ThreadPool configuration and Backpressure could be easily standardized just by agreeing on features from https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html. Particularly useful would be the integration of the statistics (e.g. Bulkheads) with the Health Check API.

Also a standardized management API (not proposed) would simplify the creation of application images through a unified API.

Java EE 8 and 9 will come at light speed to an application server vendor near you. Java EE 8 is expected to be delivered in 2017 and Java EE 9 in 2018.

Oracle is listening now, take the chance and participate at the survey (takes a few mins): glassfish.org/survey

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]>

APIDesign - Blogs - September 24, 2016 10:42 AM
Beware of DefaultMethods

DefaultMethods is a new feature of JDK8 that we many cried for. Yet, they carry certain drawbacks with themselves. For example one can write a valid Java program that compiles and works on JDK7, but is broken on JDK8!

--JaroslavTulach 10:42, 24 September 2016 (UTC)

Geertjan's Blog - September 23, 2016 06:15 PM
Minimal Oracle JET Composite Component

Let's say you have a suite of Cloud applications and you want them to display customers in a standardized way:

If that's your business scenario, then Oracle JET composite components are a perfect fit. Here's what an absolutely minimal Oracle JET composite component looks like: 

The above is really trivial. Here's the content of "customer.html":

<h2 data-bind="text: $props.name"></h2>
<h4 data-bind="text: $props.city"></<h4
<hr>

Here's "customer.json":

{
  "properties": {
    "name": {
      "description": "Customer name.",
      "type": "string"
    },
    "city": {
      "description": "Customer location.",
      "type": "string"
    }
  }
}

About the properties above, see the below:

http://www.oracle.com/webfolder/technetwork/jet/jsdocs/oj.Composite.html#metadata

And here's "loader.js", which connects the above two together and provides "customer" as a new HTML element:

define(['ojs/ojcore', 
    'text!./customer.html', 
    'text!./customer.json', 
    'ojs/ojcomposite'],
  function(oj, view, metadata) {
    oj.Composite.register('customer', {
      view: {inline: view}, 
      metadata: {inline: JSON.parse(metadata)}
    });
  }
);

In a more complex scenario, you're also able to include CSS stylesheets and business logic defined in JavaScript, as outlined in an earlier blog entry on this topic

OK, now ZIP up that folder, send it to whoever is working on other Cloud applications that need to make use of the "customer" element, which they can use as follows (in e.g., "library.js") after unzipping that ZIP into the relevant folder in their application:

define(['ojs/ojcore', 'knockout', 'ojs/ojcomposite',
'jet-composites/customer/loader'],
   function (oj, ko) {
      function libraryContentViewModel() {
          var self = this;
          self.customers = [
              {name: 'Billy Bob Thornton', city: 'New York'},
              {name: 'Brad Pitt', city: 'Hollywood'},
              {name: 'Val Kilmer', city: 'Seattle'}
          ];
      }
      return new libraryContentViewModel();
   });

All that the above does is load the "loader.js", include "ojs/ojcomposite" so that Oracle JET composite components are supported, and define a "customer" array.

Here's the view (e.g., "library.html") of the above viewModel, using the "customer" HTML element provided by the composite component:

<!-- ko foreach: customers -->
<customer name="{{name}}" city="{{city}}"></customer>
<!-- /ko -->

That's pretty neat and, guess what, Oracle JET components conform to the Web Components specification, except for the Shadow DOM, which is not supported.

Adam Bien - September 23, 2016 08:31 AM
JavaOne: Live Coding "No Ceremony" Java EE Microservices Session and Screencast

In the screencast below I created Java EE 7 projects with maven, developed and build them, created and build docker images, created a user defined network and finally launched the WARs on payara and wildfly and let them communicate:

In the first part of the JavaOne 2016 session in San Francisco I did the same. For unknown reasons docker was unbelievably slow during the presentation (I guess caused by network timeouts), so I re-recorded the first part. Now you can fast-forward over "boring" parts in the JavaOne presentation:

Any questions left? The next http://airhacks.tv is around the corner. Ask now: https://gist.github.com/AdamBien/e6e20c129e673ad558be495dd4f3afc4 or wait a month. See you at Java EE Workshops at Munich Airport, Terminal 2 and particularly at Java EE 7 Microservices. Is MUC too far? Checkout: javaeemicro.services.


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - September 20, 2016 12:27 PM
Cab Drivers in San Francisco Love NetBeans

On the way to NetBeans Day 2016, I had a nice conversation...

Here's where it is on YouTube:

https://www.youtube.com/watch?v=M2F9cik4hXs

Geertjan's Blog - September 19, 2016 01:36 PM
James Gosling on NetBeans and Apache

To a packed room at NetBeans Day 2016, at the start of JavaOne 2016, James Gosling participated in a discussion panel, where he reflected on the history of NetBeans and shared his thoughts on the plans to move to Apache.

Below, watch the final minutes, where he focuses specifically on the NetBeans plans in relation to Apache:

&amp;amp;lt;span id=&amp;amp;quot;XinhaEditingPostion&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;

Here's the view on the room from his perspective, in a photo taken by Michael Nacimento (sitting next to James):

Thanks to Victor Duran, who made the video of James's words above. 

There was a funny moment earlier in the session, where I had explained the move of NetBeans towards Apache, which I ended by saying: "We are carefully optimistic that everything will work out and our move to Apache will succeed." At that point James threw up his hands in exasperation, turned to me, and said: "Oh, have a little faith! We'll work through the Apache process!" :-)

Geertjan's Blog - September 18, 2016 11:53 AM
Getting Started with Oracle JET Composite Components

I worked with JB Brock yesterday on setting up and using Oracle JET's new Composite Component Architecture.

The aim of it all is to have reusable components that enable you to define your own HTML elements, like this, for example:

<!-- ko foreach: employees -->
<demo-card class="oj-flex-item" 
           name="{{name}}" 
           avatar="{{avatar}}" 
           work-title="{{title}}" 
           work-number="{{work}}" 
           email="{{email}}" 
           background-image="{{backgroundImage}}">
</demo-card>
<!-- /ko -->

Above you see a Knockout for-each loop which iterates through 'employees' and creates a new DOM element named "demo-card" for each of them.

The above is in the view, e.g., in "home.html", while "home.js", i.e., the viewModel, defines "employees" as follows:

self.employees = [
    {
        name: 'Deb Raphaely',
        avatar: 'images/composites/debraphaely.png',
        title: 'Purchasing Director',
        work: '5171278899',
        email: 'deb.raphaely@oracle.com',
        backgroundImage: 'images/composites/card-background_1.png'
    },
    {
        name: 'Adam Fripp',
        avatar: null,
        title: 'IT Manager',
        work: '6501232234',
        email: 'adam.fripp@oracle.com',
        backgroundImage: null
    }
];

In this case, the definition of "demo-card" transforms the above snippets into a view that looks like this, with a "demo-card" for each of the two employees defined above:

When the user clicks on each "demo-card", it flips around, and you see the other side of the card, which presents more information about the employee. (See the above live here.)

OK, so where does "demo-card" come from? Well, in "home.js", i.e., the same place where the 'employees' above are defined, my "define" block looks like this:

define(['ojs/ojcore', 'knockout', 'ojs/ojcomposite', 
        'jet-composites/demo-card/loader'],

Notice, first of all, that "ojs/ojcomposite" is included, which is new in Oracle JET 2.1.0. It defines composite components. Then, notice that something is loaded from a folder named 'jet-composites', which is a folder that looks like this:

Notice "demo-card" is a folder in there, which looks like this:

So, what you have is an infrastructure for creating encapsulated components, defined by JavaScript, HTML, and CSS, with properties defined in JSON. Once you have a composite component, you have created a new HTML element, in this case "demo-card", defined by "loader.js", which ties everything together:

define(['ojs/ojcore', 
    'text!./demo-card.html', 
    './demo-card', 
    'text!./demo-card.json', 
    'css!./demo-card', 
    'ojs/ojcomposite'],
  function(oj, view, viewModel, metadata) {
    oj.Composite.register('demo-card', {
      view: {inline: view}, 
      viewModel: {inline: viewModel}, 
      metadata: {inline: JSON.parse(metadata)}
    });
  }
);

You can pass the composite component in a ZIP file to whoever needs to use it, who unzips the ZIP into a folder, and loads it into their viewModel as described earlier, via the "define" block of the viewModel. You can see composite components as plugins for developers, i.e., not for the end user of the app, but for the development team, enabling features to be packaged, shared, and reused.

Here is a more complex example, which is a composite component called "demo-memory-game" which itself makes use of a composite component called "demo-memory-card":

All the details, including all the code described above, are here in the Oracle JET Cookbook:

http://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=composite&demo=basic

Note: When loading a composite component that includes a CSS file, remember to add 'css': 'libs/require-css/css' in your main.js file, i.e., in the "paths" section of your "requirejs.config", otherwise the composite component loader crashes when trying to execute the loading of the CSS, e.g., the 'css!./demo-card' piece. Thanks Janis Krasemann on Twitter for pointing this out. That is something I indeed did do but forgot to mention here. :-)

markiewb's blog - September 18, 2016 11:44 AM
Missing plugins for your NetBeans nightly builds?

Do you use a Nightly-/Dev-Build of NetBeans or even a release candidate of 8.2 within the NetCAT-program and you are missing some of your favorite plugins?

First there is no plugin center for Dev-Builds. Also most plugins from the 8.1 plugin center are not verified for the new 8.2 build yet – including my plugins.

Nevertheless in the meantime you can still use the plugins and give the plugin authors feedback of the compatiblity to 8.2. Some plugins won’t work, because of using non-public API, but that is the point to find out!

How to do that?

At Tools|Plugins|Settings add the plugin center URL for 8.1 [1] and then at Tools|Plugins|Available Plugins click at “Check for Newest

Additional

If you are interested in testing non-verified plugins see the article [2]

[1] http://plugins.netbeans.org/nbpluginportal/updates/8.1/catalog.xml.gz
[2] https://benkiew.wordpress.com/2013/02/03/netbeans-ide-verification-of-plugins-and-update-center-urls-for-non-verified-plugins/


Adam Bien - September 17, 2016 02:40 PM
My One And Only Microservices Live Hacking JavaOne Session

This year I was more cautious and only proposed a single session:

Live-Coding No-Ceremony Microservices [CON3436]

Java EE is productive and easy to learn and runs smoothly on containers such as Docker and rkt. It has become the perfect microservices platform. Unfortunately, no one in the enterprise is interested in managing thousands of nanoservices “just for fun.” In this session, the presenter hacks on stage a couple of Java EE 7/8 “rightsized” services, links them together, runs them on Docker, and explains the architectural decisions and best practices in real time.

This session is already available for: streaming.

Tuesday, Sep 20, 2:30 p.m. - 3:30 p.m. | Parc 55 - Embarcadero

Is San Francisco too far? See you at Java EE Workshops at Munich Airport, Terminal 2 and particularly at Java EE 7 Microservices.


Real World Java EE Workshops [Airport Munich]>

Adam Bien - September 15, 2016 06:30 AM
Java EE: Accessing Resources In Docker In Stage Environment

"How to change a e.g. JDBC URI in the configuration of a Java EE application server running in docker and staged environment?"
...is one of the recurring airhacks.com, airhacks.io and airhacks.tv questions.

The answer is: don't change it:

See you at Java EE Workshops at Munich Airport, Terminal 2 and particularly at Java EE 7 Microservices Is MUC too far? Checkout: javaeemicro.services.


Real World Java EE Workshops [Airport Munich]>

Wade Chandler's Programming Blog - September 14, 2016 03:25 AM
"Run Focused Test Method" and "Debug Focused Test Method" for NetBeans Groovy Support Now in main-golden and Nightly Builds

If you use NetBeans nightly builds you will now have this functionality. Try it out, and let me know if you experience any issues.

DukeScript - September 13, 2016 09:46 AM
SnapSVG for Java

SnapSVG is a very decent JavaScript library for rendering and animations. With great delight the DukeScript project announces immediate availability of the library for all Java users!

Check the javadoc for detailed description. Use following code to add the SnapSVG into your DukeScript application:

Paper s = Exports.Snap("#demo");
Element bigCircle = s.circle(150, 150, 100);
bigCircle.attr(values(
    "fill", "#bada55",
    "stroke", "#000",
    "strokeWidth", 5
));

Element smallCircle = s.circle(100, 150, 70);
Element discs = Element.$as(s.group(smallCircle, s.circle(200, 150, 70)));
discs.attr(values(
    "fill", "#fff"
));

bigCircle.attr(values(
    "mask", discs
));

smallCircle.animate(values("r", 50), 1000);

See the example in our Definitely Typed Java libraries project. Enjoy SVG!

markiewb's blog - September 12, 2016 07:51 PM
NB: How do I create an action which can be invoked by a macro?

Use @EditorActionRegistration!

@NbBundle.Messages({ "CTL_MyAction=Let's go", "macro-name=Let's go" })
@EditorActionRegistration(
	name = "macro-name", 
	mimeType = "text/x-java", 
	menuPath = "Source", menuPosition = 0, menuText = "#CTL_MyAction")
public class MyAction extends org.netbeans.editor.BaseAction {
 //...
}

Now your action can be invoked by a macro using its macroname (the name attribute in the @EditorActionRegistration-Annotation) and even recorded by the macro recorder.

[1] http://wiki.netbeans.org/DevFaqAddMacroableAction


APIDesign - Blogs - September 12, 2016 08:55 AM
Distribute Non-distributable

AutoUpdate is a fine NetBeans technology that can help you distribute things may see non-distributable. Here is a small demo that shows how one can fix broken NetBeans 8.1 installation.

--JaroslavTulach 08:55, 12 September 2016 (UTC)

Wade Chandler's Programming Blog - September 11, 2016 11:28 PM
"Run Focused Test Method" and "Debug Focused Test Method" for NetBeans Groovy Support in main and main-silver Hg Repositories

The ability to run or debug a single Groovy test from the IDE has now been merged into the main and main-silver Hg repositories for the NetBeans IDE. I assume this will work into main-golden and thus the nightly dev builds soon. I will post another update once that happens.

Geertjan's Blog - September 07, 2016 09:18 AM
Finegrained JShell Integration in NetBeans IDE

In addition to the generic JShell integration in NetBeans, discussed yesterday, there's more finegrained support enabling project-specific JShell snippets to be run. That means, depending on how you organize your life, no "build" will be needed anymore when you try out your code. Just hack a snippet together, run it in JShell, when/if it works, move it to your project.

Each project, whether Maven-based or Ant-based, will have an "Execute Java Shell" menu item, which is shown below. When that menu item is clicked, a new VM is created, which has access to the project's path, including project-specific JShell snippets, as discussed below.

Below you see a folder "nbproject/private/jshell-snippets", which contains JShell snippets that I know will be handy for experimenting with in the context of my project:

Also, note that there's a folder called "startup", within "jshell-snippets", above. Anything in there will be executed automatically when the project-specific JShell starts up. In the case of Maven, you'll set a property in your POM, "org.netbeans.jshell.snippetsRoot", which points to a folder in which your snippets, including the optional "startup" folder, are found:

<org.netbeans.jshell.snippetsRoot>src/jshell-snippets</org.netbeans.jshell.snippetsRoot>

Once the project-specific JShell has started either via a Maven project or an Ant project, there's a small drop-down that shows an item for each of the JShell snippets, which can be run by clicking on them:

Alternatively, you can do a Run/Debug project and then Run | Open Java Shell for Main Project, which connects to the VM where the project is run/debugged. The difference is the startup procedure. "Execute Java Shell" only starts the machine and waits for interaction from JShell, while "Open Java Shell" works with an existing process which starts as a regular application.

Adam Bien - September 07, 2016 07:20 AM
Building Integrated Messaging Solutions For Banks With Java EE Microservices

Grzegorz, please introduce yourself

My name is Grzegorz Huber and I'm a software developer at www.consdata.com. There are other titles that change depending on my current role in different projects, but I prefer the down-to-earth description instead.

What are you currently building?

We're building a mailbox application for one of the banks here in Poland. The idea is to give clients a better tooling for their needs to contact the bank whether it's a support question or a complaint. Obviously this also means integrating with internal bank mechanisms and now clients are receiving their bank statements in a much more convenient way. It probably sounds boring because we've all been using emails for years. However, designing your own messaging application turns out to be quite a challenge especially when everyone just keeps on saying just do it like Google does ;-). The domain is simple, yes, but the scale of the system make things much more challenging. Plus it's not only for messaging. We're currently integrating our mailbox application with some of our other products that add more functionalities like internet forms and automated workflow. Most of the features have already been implemented and I'm still in awe that our whole backend is under 20k lines of code. And people say Java makes your systems big.

After the Java EE Microservices workshop at MUC Airport in January you decided to refactor your current application towards pure Java EE Microservices. What is the progress?

Actually, It was a brand new application and we started in late February so the timing was perfect for us. The current progress is 10 microservices. I guess that's one way to describe our "advancement". Using other metrics we're currently in performance testing and getting closer to the production stage. That's for my current project. The side effect is a very small change within our organization that's about to take it's ripple effect to a whole new level.

How many microservices comprise your application / system?

Currently ten, but it was our first time and there were some disbelievers, who were skeptical at first, plus the learning curve so we definitely see there could be more closer to 15.

Which application servers, tools or IDEs are you using?

The most interesting is probably the Java EE part of the whole architecture where we decided to use Payara, Payara Micro, Embedded Payara for testing. Obviously is many ways inspired by the training in Munich. On top of that we developed our own installation platform based on Docker, which help us manage different parts of our application.

How big is your WAR?

It's between 3 and 8 MB. We're not super light, but we're very happy with the final result. Some compromises had to be made. For example we decided to use lombok, which adds almost 2MB to each war. Logback and its dependencies add another 700KB. Plus our db backends use mybatis, which adds almost 2MB as well. We like this strategy anyway... we try to keep these values in check and we consciously select what should be provided by the Jave EE container and what should be included with our application. I would like to be able to go with the javaee-api alone, but that's not possible ;-).

Here's the full report ;-)

3,7M lip 18 15:15 statics.war
7,0M lip 18 15:15 messages.war
8,0M lip 18 15:15 integration.war
7,0M lip 18 15:15 messages-sendmass.war
5,7M lip 18 15:15 users.war
3,4M lip 18 15:15 facade.war
5,5M lip 18 15:15 templates.war
3,8M lip 18 15:15 ecm.war
3,9M lip 18 15:15 crypto.war
3,6M lip 18 15:15 accounts.war

How fast is the build?

The whole microservice backend without tests is like 20-30 seconds. I normally don't divide build time with and without tests, but we did something here that should be mentioned. We write basic JUnit test cases in 3 layers... sort of. Layer one are basic junit tests based on mockito for simple business logic tests. Layer two includes real bean tests using CDI injection and everything that's possible within one microservice and using specialization beans that serve as mocks to other microservices. Layer three is the most expensive, but I think the pros are much more important than the disadvantage of extra added time. Our layer 3 test use the embedded Payara Micro, which takes the target wars and tests the real application stuff and including communication between microservices. We have Junit tests that use up to 6 microservice modules depending on the user story. I think that's one of the bigger challenges awaiting those who adopt this architecture so it was really handy to have Payara ready for that. The whole build, the one we use to build upon every commit for pull requests, takes up to 5 minutes at the moment.

Does "stock" Java EE fit well with the microservices idea?

Yep! It seems that it was designed this way and it's asking to be used this way. I really don't know why this approach wasn't picked up faster by developers around the world :).

You are using the porcupine as Bulkhead. Which problem does it solve?

Well, even though Glassfish (and Payara) have built-in monitoring it wasn't what we wanted it to be. Instead with a proper application design and splitting code across different microservices and different executors we were able to get our own dedicated monitoring service via REST plus other small things like named threads for each module. Additionally there's this feeling that you're in complete control over how different modules have different configurations for their own executor services. The added benefit of using Porcupine right away is that when you think about stuff like thread pools at the beginning of your application it's much easier to scale your system in the future.

Are you still happy with Boundary Control Entity?

I don't think we use that in the direct way. We definitely don't use technical names for organizing the core within our microservices and our approach is still based on the business responsibilities of the classes.

Any major challenges so far?

Apart from different approach to testing, which I think we tackled head on, the biggest challenge is probably some sort of microservice registry that's we're still missing in our project. Using Docker helps here a little bit, but when you get 10+ microservices and you really want to use them independently it's good to have something this figured out. One of the main reason why I came across your training was an idea to replace OSGi with something lighter. Microservices are indeed lighter, but you still have to manage them on your own. There are many solution that help with that, but I feel we need to be careful here, cause adding a registry is a good idea, but it can't become a single point of failure for us.

Any closing thoughts on Java EE and microservices?

It's nice to be able to design modules in such way that the main application operation is designed to work 24hrs per day and other heavy operation, which may bring instability to the system are in separate modules on different servers with different boundaries.

That's nearly impossible with a monolith and usually it's too late. In our case we had 9 microservices at one point and the 10th was brought to life when we realized that our core business logic is so fast and small that it runs smoothly on 1GB of RAM and the other module is doing this big batch operations and needs additional 6-8GB of RAM. It would be ill-advised to run them both together on a 8GB RAM system.

Business-wise both modules send messages. The microservice way of thinking let's you split code not only using domains but ever further when there are other benefits like performance and stability.

Is you company hiring Java (EE) developers?

Yes, checkout: kariera.consdata.pl/

Can you share any resources with us?

Here you can learn more about our software www.consdata.com. Feel free to contact me at ghuber@consdata.pl if you have any questions.


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - September 07, 2016 03:42 AM
Learning Java with JShell in NetBeans IDE

Let's use JShell to learn about Paths and Files and Streams... here we go... this seems to work, since the Output window prints out the content of my file, which has two lines "hello" and "world":

Sweet documentation explains everything:


Next, let's put that useful code snippet to some use... i.e., we'll move it into a new Java source file in my application:

And there it is, all the verbosity/expressiveness of Java wrapped around our little snippet:

Hmmm. This will be pretty useful for anyone teaching and/or learning Java.

Wade Chandler's Programming Blog - September 07, 2016 03:41 AM
Adding "Run Focused Test Method" and "Debug Focused Test Method" to NetBeans Groovy Support

If you are a NetBeans and Groovy fan, then you have probably noticed over the years you can not execute nor debug an individual test method if using Groovy for testing. I have contributed to other parts of the IDE at various times, but hadn't looked into the Groovy support until recently. I finally had enough executing all tests in a file.

The code isn't necessarily difficult. For what I am adding it is slightly complicated due to NetBeans Groovy support module dependencies, and some things needing to be broken out a little differently. For now I am using reflection to access what I need, and that will work fine enough in the near term. Long term I plan to work with other community contributors to clean things up.

Another thing which makes coding this interesting is a mismatch between NetBeans notion of an offset into a source file and the Groovy ASTs notion of it. NetBeans uses a cursor or single integer value offset, and Groovy uses the notion of a line and column. So, some translation and AST traversal is needed to pinpoint the selected method. Standard editor things, but of note for this fix.

Too, the previous code halfway attempted to do this, but it seems some copy and paste happened between the Java and Groovy support as that code was using Java specific features which will not exactly work as Java is a subset of Groovy. The Groovy AST classes along with a little translation fixed it right up.

The changes should make their way into the code base soon. I have things working locally. I am now cleaning things up. I figure I will tackle other items which bother me about NetBeans Groovy support now that I am getting into it.

I will update once merged in, so check back.

Adam Bien - September 06, 2016 06:28 AM
React, Angular 2, Microservices, High Performance Java EE, Q & A -- Early Autumn Events, Conferences and JUGs

  • Mission Impossible: From HTML 5 to Native Applications, Workshop for Java EE developers, Rapperswil, Tuesday, 13th September. My goal is a (code) walk through the current JavaScript / HTML 5 / CSS eco system. This course is targeted to Java EE developers -- at least I will provide as many as possible relevant samples from the Java EE ecosystem to explain HTML 5 && Co.
  • Live Q&A streaming: October, 3rd, 6 pm CET: www.ustream.tv/channel/adambien Any questions left? Ask now: https://gist.github.com/AdamBien/e6e20c129e673ad558be495dd4f3afc4
  • Live Coding "No-Ceremony" Microservices, CON3436, September, 20th, 14:30, 15:30, JavaOne Conference, San Francisco. Last year I got too many questions and there was no time left for coding. This year I plan to code, build and deploy as many cycles as only possible. Docker, Java EE, Networking, Configuration & Co. topics included. I will answer the questions from the audience concurrently -- without any breakpoints.
  • Live streaming session, Internet Mobile World, "Building Backend Services -- Fast and Straight" imworld.ro
  • Live streaming session, High Load Conf, October, 15th, "Lightning Java EE -- What Is Possible With Stock Servers", hdconf.by
  • October, 19th, JUG Poznan session: "Microservices in 2016 — What Worked Well (this time completely without slides)". This session is about lessons learned and the most frequently asked questions about Microservices and Java EE. This time I plan to spend 99,99% of the time in the IDE. The more questions -- the better.
  • airhacks.com workshop: MUC airport, October, 24th Building React Apps. From setup, over build, to "hot deployment" with the JavaScript "Framework" react. After several React project I would like to present some "working practices".
  • airhacks.com workshop: MUC airport, October, 25th Building Angular 2 Apps. In this workshop I will focus on Angular 2 and will cover the typical project lifecycle - from setup over deployment. This workshop is similar to the "Building React Apps", but only covers Angular 2.

Coming this winter: 5 days Java EE Airhacks: from Bootstrap, over best practices, architectures, testing to microservices: http://workshops.adam-bien.com

Also checkout workshops on-demand: airhacks.io.


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - September 05, 2016 09:55 AM
Tip for JavaOne Speakers with NetBeans IDE

Quite a few speakers at JavaOne 2016 will be using NetBeans IDE for demos during their sessions. Excellent. Less excellent is the yelling that will befall you when your audience wants your font to be bigger.

So. BEFORE your session, make sure you're comfortable with the "Zoom Text" keyboard shortcuts, which are set as following by default:

Under pressure, I'm not so great with the mousewheel on my keyboard and so I have remapped the "Zoom Text" keyboard shortcuts as follows, i.e., to Ctrl+PAGE_UP and Ctrl+PAGE_DOWN. (These do override existing keyboard shortcuts, which I never use anyway, i.e., tabbing left and right, I think.)

That's much better and now I have full control over the font size in all the editors in NetBeans IDE via two handy keyboard shortcuts.

Geertjan's Blog - September 05, 2016 07:00 AM
"grunt clean" for Oracle JET

In your Oracle JET application, when you look in Gruntfile.js, you'll see "build" and "serve" are Grunt tasks that have been registered for you.

Let's add a new one, so that we can do "grunt clean":

grunt.registerTask("clean", (buildType) => {
  grunt.task.run([`oraclejet-clean:${buildType}`]);
});

Of course, "oraclejet-clean" does not exist, yet.

In "node_modules", go to "grunt-oraclejet". In "tasks", copy "build.js" and name it "clean.js".

Rename most references to "build" to be "clean" instead, which gives you this. The only changes I made are in bold:

'use strict';
const ojet = require('oraclejet-tooling');
const utils = require('./utils');

module.exports = function (grunt) {
  grunt.registerTask('oraclejet-clean', 'clean oraclejet application', (target) => {
    utils.logModuleName();    
    utils.validateFlags(grunt, grunt.option.flags());

    const done = grunt.task.current.async();
    const platform = utils.validatePlatform(grunt.option('platform'), grunt);
    const options = utils.validateBuildOptions(grunt.config('oraclejet-clean'), platform);
    const buildType = target || 'dev';
    options.buildType = buildType;
    options.buildConfig = grunt.option('build-config');
    options.theme = grunt.option('theme');
    options.sassCompile = grunt.option('sass');
    options.destination = _getDestination(grunt);
    ojet.clean(platform, options)
    .then(() => {
      done();
    })
    .catch((error) => grunt.log.error(error));
  });
};

function _getDestination(grunt) {
  let destination;
  if (grunt.option('emulator')) {
    destination = 'emulator';   
  } else if (grunt.option('device')) {
    destination = 'device';
  } else {
    destination = grunt.option('destination');
  }
  return destination;
}

The above could probably be a lot less, yes, cleaned up, quite a bit, most of those options not being needed in this context.

Also note in the above, take careful note of this:

ojet.clean

The above is the "clean" task, which exists though it hasn't been hooked up yet.

Again in "node_modules", go to "oraclejet-tooling". In the "lib" folder, notice that "clean.js" already exists. Now go one folder up into the root of "oraclejet-tooling", where you'll find "oraclejet-tooling.js". In there, include "clean" to the for each loop, as shown in bold below:

['config', 'build', 'serve', 'clean'].forEach(function(name)
{
  ojet[name] = require('./lib/' + name);
});

Now run "grunt clean" and, if the folder into which your app has been built, e.g., "web", exists, it will be emptied. The folder itself will remain, though its content will be deleted.

Adam Bien - September 05, 2016 05:33 AM
Java EE 8 Is Coming, Docker Hub, Configuration, AMQP, DTO Not Dead or 30th airhacks.tv

117 live attendees, 13+ questions, or the 30th airhacks.tv is available:

Any questions left? Ask now: https://gist.github.com/AdamBien/e6e20c129e673ad558be495dd4f3afc4.

The questions above are going to be answered during the next "Airhacks Q & A" http://airhacks.tv live. You can subscribe to the channel and / or for the next event: http://www.ustream.tv/channel/adambien (both is optional, no registration required to watch this event live).

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]>

Geertjan's Blog - September 04, 2016 12:10 PM
My JavaOne 2016

Here's where I'm speaking (in bold) some with others and some alone and what (I'm hoping) I'll definitely be attending (not in bold):

  • Sunday: NetBeans Day

  • Monday:
    • 8:30 a.m. - 10:30 a.m. | Rapid Development Tools for Java EE 8 [TUT1869] | Hilton - Continental Ballroom 6
    • 11:00 a.m. - 12:00 p.m. | Ten Essential Building Blocks of JavaScript in the Enterprise [CON6218] | Hilton - Plaza Room A
    • 1:30 p.m. - 3:30 p.m. Booth
    • 4:00 p.m. - 5:00 p.m. | How to Plug into NetBeans in 60 Minutes [CON5816] | Hilton - Continental Ballroom 7/8/9
    • 7:00 p.m. - 7:45 p.m. | Java 9 Module System Support in the NetBeans IDE [BOF4512] | Hilton—Continental Ballroom 6

  • Tuesday:
    • 11:00 p.m. - 12:00 p.m. | NetBeans RCP in Practice: An Ideal Platform for Scientific Computing [CON4439] | Hilton - Imperial Ballroom B
    • 12:30 p.m. - 1:30 p.m. | Strategies for Loose Coupling in Large Java Desktop Applications [CON6219] | Hilton - Imperial Ballroom B
    • 5:45 p.m. - 6:45 p.m. | Hands-on Lab: Learn the Basics of Oracle JavaScript Extension Toolkit [HOL5278] | Hotel Nikko - Nikko Ballroom III (3rd Floor)
    • 7:00 p.m. - 9:00 p.m. |  Enterprise JavaScript with Oracle JavaScript Extension Toolkit [HOL7764] | Hilton - Franciscan Room C/D

  • Wednesday:
    • 11:00 a.m. - 11:45 a.m. | Oracle JavaScript Extension Toolkit: Open Source and Ready for You [CON5257] | Moscone West - 2016
    • 13:00 a.m. - 14:00 a.m. | Depending on Vulnerable Libraries [CON6265] | Hilton - Golden Gate 2/3
    • 15:00 a.m. - 16:00 a.m. | Safe Architecture Migration and Enforcement with Jackpot and Annotation Processors [CON5859] | Hilton - Continental Ballroom 7/8/9
    • 16:30 a.m. - 17:30 p.m. | Ten Essential Building Blocks of JavaScript in the Enterprise [CON6218] | Hilton - Plaza Room A

Upating the above, it is not complete yet.

DukeScript - September 02, 2016 11:46 PM
Role based UI with DukeScript

It’s a very common requirement to show or hide elements in a UI based on the users roles. Depending on the view technology this can be quite a challenge. The most convenient way to do this, is by declaratively marking the sections. With DukeScript it’s pretty simple. You can bind the visibility of an element to some property in the view model.

The problem is, that you need to introduce a lot of properties in your viewmodel. It would be much better, if you could simply add roles to a global user object and use this to control visibility:

<h2>Content</h2>
<div data-bind="authorize: 'admin'">
        <div id="vm1" >
            Totally secret stuff=<span data-bind="text: prop"></span>
        </div>
</div>
<div data-bind="authorize: 'reader'">
    <div data-bind="stopBinding: true">
        <div id="vm2" >
            Public=<span data-bind="text: prop"></span>
            <div data-bind="authorize: 'editor'">
                A bit less public=<span data-bind="text: prop2"></span>
            </div>
        </div>
    </div>
</div>

The user object can live in our root context and we can check if this user has the required roles:

@Model(className = "SecurityManager", targetId = "", properties = {
    @Property(name = "user", type = User.class)})
public final class SecurityBinding {

    @Model(className = "User",
            properties = {
                @Property(name = "name", type = String.class),
                @Property(name = "roles", type = String.class, array = true),
                @Property(name = "availableRoles", type = String.class, array = true)},
            targetId = "")
    public static class Uservmd {}
}

Now we need to create the “authorize”-binding. The tricky part is, that this needs to work in any binding context. If we bind several viewmodels to different parts of the page, each of them has their own root context. So we cannot rely on a common $root.

In this example I’m using document.getElementById(“security-manager”) to get hold of an element in the relevant root context. I get the User object from it and subscribe to changes in the users roles:

@JavaScriptBody(args = {}, body = "ko.bindingHandlers.authorize = {\n"
            + "    init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n"
            + "         var value = ko.unwrap(valueAccessor());\n"
            + "         var user = ko.contextFor(document.getElementById('security-manager')).$root.user();\n"
            + "         var roles = user.roles;\n"
            + "         if (roles().indexOf(value)==-1){\n"
            + "                 element.style.visibility='hidden';\n"
            + "             } else { element.style.visibility='visible'; }"
            + "         roles.subscribe(function(changes) {\n"
            + "             console.log('change in roles checking for role '+value);     "
            + "             if (roles().indexOf(value)==-1){\n"
            + "                 element.style.visibility='hidden';\n"
            + "             } else { element.style.visibility='visible'; }"
            + "         });\n"
            + "    },\n"
            + "};")
    public static native void init();

If the user has the right role, I show the element, otherwise it will be hidden. A pretty simple way to control access in a fine-grained way.

You can try it out yourself. I created a github project for you to play with:

https://github.com/dukescript/securitymanager

Adam Bien - September 01, 2016 11:57 AM
Running A Stock Java EE 7 Thin WAR On Docker

Java EE separation of plumbing and pure business logic (aka Thin Wars) makes Docker builds fast and the images small:

The Payara and WildFly images in this screencast were taken from: https://github.com/AdamBien/docklands and hosted on: https://hub.docker.com/u/airhacks/

Interested in productive microservices? Checkout: javaeemicro.services, or visit MUC's airport: Java EE 7 Microservices.


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - September 01, 2016 09:04 AM
From Oracle JET Web to Hybrid

A 'web' project scaffolded using Oracle JET 2.1.0 can be extended with 'hybrid' features.

You can then build both web or hybrid app from the same sources.

To add the 'hybrid' capabilities to a web project, use the oraclejet:add-hybrid command in the application directory:

yo oraclejet:add-hybrid --platforms=android|ios|windows --appid=com.my.app --appname="My Hybrid App"

The --appid, --appid, and --platforms options take the same values as the yo oraclejet:hybrid generator.

The oraclejet:add-hybrid command creates a Cordova project and two new source directories 'src-hybrid' and 'src-web' in the application directory. These directories can be used for any source content that is specific to the hybrid or web mode respectively. For example, when building a hybrid app, the src-hybrid/index.html file (if it exists) takes precedence over the "common" src/index.html.

Adam Bien - August 31, 2016 06:12 AM
Docklands: Java EE Docker Images In "Docker Central"

Docklands comprises Java EE-relevant (Wildfly, Payara, TomEE, WebSphere Liberty, WLS, Tomcat (...)) Dockerfiles, directly available from hub.docker.com/u/airhacks/.

Docklands images are heavily relying on image layering.

A typical Java EE application comprises the following layers:

  1. airhacks/java: the OS + Java layer. Only serves as a base, "abstract" layer. Changes on OS and Java releases and patches.
  2. airhacks/[appserver]: this layer inherits from airhacks/java and only contains the application server installation. Only changes on new application server releases.
  3. airhacks/[appserver]-configured: inherits from 2. and contains project-specific configuration like e.g. JMS Queues, JDBC DataSources etc. Has to be rebuilt on projects-specific configuration changes like e.g. -Xmx or -Xms changes. This layer is optional
  4. airhacks/[project-name]: inherits from 2. or 3. Only contains a Thin War. Is rebuilt with each mvn package

Fortunately the base images are big, but have to rebuilt only a few times in year. The application / project images change several times a day, but are tiny. The creation of a full docker image with https://github.com/AdamBien/docklands takes usually: ~100ms and only adds the WAR size (usually a few MB) to the total size.

The base images exist only once at your hard drive and are shared across different application servers and applications (aka microservices).

Try it: docker run -d -p 8080:8080 --name payara-ping airhacks/payara-ping

Checkout docklands for the sources, or docklands at hub.docker.com for ready to use images.

Docklands in action:

See you at Java EE Workshops at Munich Airport, Terminal 2 and particularly at Java EE 7 Microservices. Is MUC too far? Checkout: javaeemicro.services.


Real World Java EE Workshops [Airport Munich]>

Adam Bien - August 30, 2016 05:11 AM
Thin WARs, High Productivity And 10k Transactions Per Second On Stock Java EE 7

Pavel, please introduce yourself

My name is Pavel Pscheidl and my role can be best recognized by “full stack developer”. I live and work as a Java EE developer. Recently, I’ve started Ph.D. studies at Faculty of Informatics, University of Hradec Kralove. Personally, I’m interested in automation systems used for decision support in daily life. Home automation and healthcare systems are my current focus. I’m also a passionate user of Mozilla’s Rust programming language.

What are you building with Java EE?

Commercially, my last allocation was at Zentity, where we built mobile banking backend systems, where all the business logic lies. Zentity’s main customers are big european banks and telecommunication providers. Our backend systems must integrate into existing bank environment, provide the necessary security layer, service orchestration, caching or load balancing. I used Java EE for these projects of course.

However, there is also plenty of space for Java EE at the University. First, Java EE is taught there very well and many things are explained to students - from basic understanding of application servers and the principle behind servlets to advanced stuff. It has it’s space in research projects as well. Home automation systems and Internet of Things projects are current projects with Java EE involved. We also have internal systems based on Java EE. Lately, we’re building lots of microservices with “very fat” business logic for home automation. JAX-RS is clear choice here.

There are also lots of other projects, both commercial or internal projects at the university. It is fair to say that I use Java EE 7 for a long time. We’ve flawlessly migrated older projects to Java EE 7 containers long time ago.

Can you share with us some geeky numbers like e.g. TX per seconds, heap sizes etc -- whatever Java EE devs might find interesting.

I’ve spent quite some time measuring the performance of REST APIs on my projects. The banking systems we built were tested to handle 10,000 requests per second. Benchmarked with both Resteasy and Jersey as JAX-RS implementation. It could actually be achieved with WildFly and it’s load balancing capabilities pretty easily and cheaply - I found that fact interesting. It depends how the request looks like of course. I can not discuss details publicly, but I can tell that one request could allocate up to 5 additional threads from the thread pool managed by the application server as it waited for other services and the whole request could last for up to a second. Typically between 150-200 milliseconds. Java itself and of course Java EE always proved to be very fast and easily scalable here. Under usual load, the heap usage is always under 1 GB per node and I’ve never seen it exceeding 2 GB on common projects. I can’t actually offer big, sensational numbers. And that is what I enjoy probably the most. Having a virtual machine with 8 threads and 2 GB of memory spawned in no time and letting it handle thousands of clients for several years without problems is what impresses me. Just yesterday, I was forced to restart WildFly 8 after a year and seven months of uptime due to CentOS upgrade.

Are you happy with Java EE so far? Is Java EE productive?

Very happy. Ease of development is the main reason. Everything is kind-of prepared and standard ways of doing things make sense, for example data sources and JNDI. Customers are happy with application servers, where everything can be set up easily via web interface in detail. There is no configuration hell and JAR hell. Everything required is already present at the application server. I commonly use few additional CDI extensions in every project that further improve simplicity. There are many, but I’d like to point out Apache Deltaspike. We even developed set of custom CDI extensions that are very specific for given domain - they do non-trivial work for developers and newcomers are not even aware of them. Overall, I like how Java EE reduces application’s complexity to bare minimum. Projects in Java EE 7 are highly domain oriented - this means there is minimum amount of configuration and new developers orient easily. In enterprise environment, this is actually a big deal.

Which tools or IDEs are you using?

Any Linux-like OS is what I strongly prefer - a proper terminal and a set of basic tools is a must (ab, curl, scp, ssh…). I use IntelliJ Idea for some Java EE projects based on Gradle. However, NetBeans is my strong preference. So for the majority of time, I use NetBeans + Maven rather than IntelliJ. When NetBeans comes with decent support for Java EE projects built with Gradle, I will probably stop using IntelliJ completely. Besides Java IDE, I always have Sublime Text 3 and Postman opened. I should also mention Enunciate - a tool to generate JAX-RS REST API documentation. That is pretty much everything I commonly need.

You migrated to Java EE 7 and WildFly. Are you happy with the decision? What was the outcome?

Yes, I am extremely happy with the decision. I migrated to pure Java EE 7 projects mainly because I started to seek an alternative. I developed projects using many technologies and frameworks. Some projects were in Ruby and I was even using Python + Django for websites. Mainly, I was using Spring. I was taught to use it by everyone “since Kindergarten”. I still do not get it - heavy marketing, fancy words, but the reality is different and ugly with many custom fixes and lots of custom code not oriented on the problem domain. I am awared that this is a controversial topic, but after the years I just feel this way. I soon dropped all of the previously mentioned and focused only on Java EE 6, later Java EE 7. And life became easier - which is exactly what I wanted. So the overall outcome of switching to pure Java EE 7 is easy living :) There are many open standards which reflect real world requirements in Java EE. Such set of open standards is then implemented and usually undergoes a process of testing, improving and bug fixing - bug free software is a myth. An application server represents a well tried, periodically fixed set of such libraries used by many. And when it is used and developed by many, it is usually more trouble free then solutions wired together individually. Wiring everything together on our own always ended up in troubles. The problem repeated across companies and developers. And I don't want that back. Projects are now tidy and domain oriented, no configuration hell, no dependency hell. Java EE has CDI, which I personally call “Java EE-core”. Majority of things in Java EE relies on Dependency Injection and design patterns built around/on top of it. And CDI is extremely well designed and feature-complete. I think it is the top reason why working with Java EE is so easy and understandable. With extensions, it is a pleasure to work with. Even Spring Data is now available as a CDI extension. But I’ve tried it and happily returned to Deltaspike Data. A real benefit is that projects are also actually transferable from one AS to another with little effort. The certification process helps here. In real world, the choice of application server proved to be of great importance. It doesn’t matter that much for the application itself, but the environment the application is deployed into matters. Servers often come with some additional functionality. For example, WildFly has great load balancing capabilities. I’ve used that several times and it was capable of literally saving client’s ass - for free. I also started to use Payara for both production and development not so long ago. Right now, I am exploring newest WebLogic, just to discover new possibilities. So I’m not a RedHat-centric person, but I found Wildfly/JBoss to be well documented and easy to understand for both developers and administrators. What I don’t like is the presence of Hibernate. EclipseLink is my strong preference. Hibernate sometimes requires special treatment when used as JPA implementation (e.g. LazyInitializationException). I have definitely faced some bugs and troubles, especially in the beginning. But everything was resolved quite fast and it was AN EXCEPTION, NOT A RULE - and this is what matters to me.

How big is your WAR?

Smallest ones are hundreds of kilobytes. Projects under 1 Megabyte are usually REST-based services connected to some kind of relational database. More complex applications are about 1-4 Megabytes with all libraries included. When the application is a website, the WAR gets bigger - all the graphics and styles take some place. My recent web projects were slightly above 5 MB. I took a quick look to my repositories and the largest project I could found is slightly over 7 MB. And that includes Primefaces themes, which we’ve also used on some projects.

Can you briefly describe the architecture of your application?

To my surprise, I do service-oriented architecture more than ever. In these cases, the complete system usually consists of < 5 WARs connected with REST interface (JAX-RS). There is no service hell, usually there is only the main application carrying all the bussiness logic and other applications oriented onto a different domain, for example security. Horizontal scaling can than be done independently. I am heavily influenced by domain-oriented design, so the components themselves are organized and named according to the problem domain. Projects created with domain-oriented design in mind proved to be much more easier to understand to other developers. For web-based applications, one WAR with JavaServer Faces is the golden standard. For projects based on AngularJS and simillar frameworks, a REST API is created (again using JAX-RS).

How important are standards for you? Does your application depend on application server specific APIs?

Standards are very important. But not everything can (and probably should ?) be standardized, I think... It is probably better to use new things in a form of external library or let’s say a CDI extension. If possible. As I stated earlier, standards represent a collective effor. And Java EE has very capable and enthusiastic people in it’s community. My applications do not use any application server specific APIs. Sometimes, they use specific APIs for databases, where I completely drop JPA and use for example Morphia for MongoDB, integrated via a simple producer.

Which Java EE APIs are you using in your products?

Many. JAX-RS, CDI, JPA, EJB, JSF and JAX-WS are the most commonly used ones. Also managed thread pool is accessed via Java EE API. Rarely, JMS is used.

Take a look at the Java EE 8 APIs. Which of the APIs are most interesting / important to you?

I am definitely most interested in JSR 372: JSF 2.3, JSR 370: JAX-RS 2.1 and JSR 375: Java EE Security API. Java EE has some security modules in a form of CDI extension and securing a JSF-based web projects is a piece of cake, but I believe the time has come for a standardized solution.

Can you share any resources (blogs, etc feel free to promote yourself) with us?

The best resource is currently my personal blog / website. There are few other resources as well: Faculty of Informatics, UHK, or our Home Automation System. I also have a personal GIT repository. More projects there are actually not a big secret, but hidden. My GitHub will be growing soon I hope, because we’ve decided to license all our university projects under GNU GPL and make them publicly available.


Real World Java EE Workshops [Airport Munich]>

Adam Bien - August 29, 2016 07:58 AM
Lightning Fast Java EE 8 and 9 Releases, Running JMS Servers, Configuration Managment or Questions for the 30th airhacks.tv Q&A

Questions for the 30th airhacks.tv, today (August, Monday, 29th) at 6pm CET (checkout recent episodes):

  1. Lightning Fast Java EE 8 and 9 Releases
  2. Docklands on hub.docker.com
  3. How to run JMS Servers
  4. MDB and AMQP
  5. Managing environment specific configuration without a DB
  6. How to stress test WebSockets?
  7. Nashorn and Docklands
  8. Using DTOs as data encapsulation pattern
  9. Personal opinion about Angular 2, React and Co.
  10. Manipulating data in JPA Entity accessors
  11. Storing data in a secure cookies
  12. Generating large PDF documents
  13. A Java Project of the month

The questions above are going to be answered during the next "Airhacks Q & A" http://airhacks.tv live. You can subscribe to the channel and / or for the next event: http://www.ustream.tv/channel/adambien (both is optional, no registration required to watch this event live).

If you still miss a question, ask at https://gist.github.com/AdamBien/37a17360d3cdc278c1a98847dc1c5359, write a comment on this post, tweet your question with the hashtag "#airhacks" or mention me https://twitter.com/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]>