Java EE application servers separate the stable infrastructure from application code. Running Java EE applications (WildFly in the following screencast) on docker containers can significantly speed-up your build and start times. You only have to build what varies and not the whole infrastructure.
In the following screencast I'm running docker and the IDE on the same machine. In practice the server and development environments are separated what should result in even more dramatic results:
Thank you for watching, feedback is highly welcome!
You mentioned in an earlier video the BCE package structure. For business-cases, this is really straight forward and a good structure.
But there are many concerns, which does not really fit in this structure (sort of cross-concern), and because of this I have the question: Where
to put the following concerns/classes:
ResourceLocator (für REST-SubResources) bzw. AbstractResources
(for functionality, which every resource needs (like @Context definitions))
DateUtil? / MailService?
Tracing mit LoggerExposer?
ValidationController / Validation-Annotations (which do not belong
to a concrete domain-object, but is rather used for any validation) [Ulrich C.]
Is it ok to use DTO in a REST-method for request/response-payload?
I would argue, that the DTO for the REST-method would separate the domain from a technical interface (REST). In addition, there is the possibility to version the interface (DTO) independently from the domain objects. Furthermore, there are some properties, which needs to be send via REST-interface, which are not needed in the domain objects. [Ulrich C.]
I’m 21 years old , and i’m at 3rd year studying Computer Science. At the moment i’m creating some apps in Java and more specially in Android , i like the server side applications too.
What i have seen so far is that Java is very powerful but we must always look at future.
By that i mean C# with mono-project.com you can write the truly write once run everywhere that Java tried to offer.
So i’m asking the Java guru if i should change to C# ?
Also one more question , for next month’s Q&A : How annotations are useful ? Explain few of them.
Thanks in advance and sorry for your time. [Giorgos]
I have long been a fan of JDO and welcomed JPA. Using annotations it is very easy to persist objects. However, there are very few examples to be found about how to persist third-party objects (assuming said objects provide getters and setters that will not change). I am thinking that using a wrapper around the objects would be one way to go, but I would like to hear how you would approach this. An example would be great, too. [Eddy]
Which cdi annotations are available in jsp? I want to use conversations coped to design wizard form. TY @8indaas
Where would you put interceptors ?
By definition they are “cross-cutting”.
In the project I am currently doing I have the boundary, control and entity packages for each business “component”. Because of the cross-cutting nature of interceptors I created a fourth package currently named “interceptors”. I know ! That’s technical like “ejb” and “jsf” ! I thought about putting it in a control package. But the control package of which business component ? Just choosing at random a component seems contrary to the “cross-cutting” nature of interceptors. It would also introduce unwanted dependencies at the component
level. Your insight on this would be much appreciated.
could you please show how to Unit-test a boundary utilizing other @Stateless and @Inject (CDI) objects? What exactly do i need to test it fastly without having Arquillian in place?A simple example would be very helpful. Karsten
Is there a way to have dynamic finders in JPA like Grails or Rails? Any plans to include this feature on the new MVC framework? Antonio
This one might be a little off topic but I figured its worth a try asking. How do you go about setting up a datasource in wildfly that talks to a mysql server via ssl. I have the mysql server’s cert as well as a client key/cert combo. Brett
I have one more question. How to test two microservices where one communicates with the second.via REST. Exactly I wonder which interfaces should I mocked. Right now (we don’t have exactly microesrvices :)) I test both applications separately. Is it enough? Someone can for example change interface - I know that this is a strange reason but can happen :) Sebastian
Question 1 : is it possible build web application MVC1 ( ozark ) with JAVAEE7 ? is it enough matured currently for large scale web application ?
Question 2 : in JPA based app. I am facing some problem in
em.mergeI().—————— transaction related problem.
to overcome this problem i am use em.createNativeQuery (“update into”).
please give comments : is it recommend write way ?
Question 3 : what is the best practice primary key generation for large scale financial application ? (for jpa)
Could you suggest how to organize CI process with jenkins and docker. I have a set of the java ee apps and for each of them I configured docker. So, I want to use jenkins to run integration tests and then rebuild image and rerun container for each application.
As I understood the most straightforward way is to use separate VM for CI with preinstalled docker and jenkins on localhost. So, Jenkins tracks changes, updates source, then runs IT via maven and then reruns containers on localhost.
But docker has official image for jenkins and I remember that you use it. If you run jenkins in docker container, how do you organize access to parent host for running IT, rerunning containers with apps? Or do you use docker in docker approach? Here is an example https://github.com/jpetazzo/dind Or maybe another way …. I’m really confused :) Andrii
Can you provide an example of how to send text to cell phone from web application? Some sites provide an authorization code to cell phone as part of authentication. Patrick
When using bce and jsf where do you place your backing beans? team4rk
Youstice is a company and cloud-solution that helps resolve customer complaints and make shopping trouble-free. With Youstice , companies can seamlessly communicate and handle customer complaints within a matter of minutes. Similarly, disgruntled customers can get prompt assistance with their issues and save valuable time with the possibility to escalate their complaints to a neutral 3rd party for an independent decision.
Which technologies is youstice.com using on the backend?
The solution consists of 3 pillars:
the application itself - developed in a proprietary JVM-based, full-stack development and runtime platform, running on Tomcat,
the integration gateway (API) - facilitating the communication between 3rd party SW and the application, developed in J2EE,
plugins into various e-shop platforms and other points of entry - utilizing various technologies including PHP, Java, C# and others - as needed
You decided to use JAX-RS 2.0 / Java EE to implement the API, why?
First, we needed to be platform-independent, hence JAVA and the JVM. Choosing J2EE as our framework was a no-brainer for several reason:
all the components are already integrated (no wasted time by fiddling with the integration of 3rd party libraries),
is well-established and has a solution to the most pressing issues that a developer would encounter in an enterprise or even in the wild-wild world of cloud solutions, and
is open, versatile and future-proof,
is lean to run and quick to develop.
To give credit where credit is due, Adam Bien (and his videos about "Lean J2EE" on youtube) played a big role in changing my opinion on J2EE a couple of years ago.
How many developers are working on the API?
It was a one-man project since the beginning.
What about the performance?
Development performance is remarkable. We estimated it to 5MD (net effort) to get on feature-parity with the old-version, which we delivered (excluding translations, bug-fixing and tuning). Runtime performance has also improved. Rewriting the API to J2EE helped us to increase the number of requests handled per second three-fold on the same hardware, and, at the same time, eliminate the occasional drop-outs. This migration also opened up possibilities and functionalities that were not available before, or would have required a considerable amount of extra-code.
What is your experience with Java EE so far?
Still learning it, of course. The more I learn about and work with Java EE 7, the more I realize the level of development (and also runtime) efficiency it offers. That said, I guess it's still too easy and tempting not to follow the rules (TM) and end up with >X (=your time here) minutes of compilation times, sending development efficiency to the rock-bottom. So it either requires a really stubborn adamancy in sticking to the rules (TM) or considerable level of expertise.
I'd also like to note, that the number of quality materials specific for Java EE 6/7 is very limited. There are plenty of gems in the platform (especially in conjunction with JDK8) that are either well-hidden or difficult to understand/combine properly at first, yet are huge time-savers for the knowledgeable. A big thank you goes to you, Adam for doing your best to fill this gap. The blogs, Q&A sessions and the trainings are worth gold. So far every session I attended resulted in hundreds of lines deleted, dependencies dropped, features increased, builds simplified.
Which tools, servers, IDEs, external libraries are you using?
IDE is NetBeans. Previously it was Eclipse, but I haven't seen it since my first airhacks session in Munich. As a matter of fact, it was easy to convince my colleagues to switch as well. We utilize Jenkins, SonarQube and Jacoco for the quality cycle. The application server we use is Payara. Important 3rd party libs include querydsl, jersey and jackson. Lately, we introduced porcupine to fight back-pressure and swagger to document our API. However, the overall trend is to shrink the .war size. Currently it's half the size it was 6 months ago. It's partly Payara's advantage (ships many commonly used jars, like jackson) and partly our internal effort to get rid of external dependencies. We even consider dropping jackson in spite of the performance advantages.
You attended the airhacks.com workshops in Munich. Do you had the opportunity to chat with other attendees? What was the most interesting project?
Knowledge sharing between participants is something I especially enjoyed during the last 'micro-services' sessions. The attendants were all seasoned professionals who've brought their lessons learned from past projects. It was very interesting to see how certain challenges pop up in almost every organization (and the different solutions or attempts) as well as learn about the rare cases. Out of the projects I've learned about, the most interesting one for me was tipi.camp - AFAIK they were running glassfish on an embedded raspberry.pi device to monitor showers in camps.
Any resources, links (shameless plugs) you would like to share with us?