More Questions Than Ever: The 16th Airhacks Live Questions And Answers 📎
Questions for the 16th airhacks.tv at July, 6th 2015 at 6.PM. CET: http://www.ustream.tv/channel/adambien (no reqistrations, no obligations, just ask questions and watch :-)):
Do you see JavaScript frameworks in your work yet? Do you see MVVM becoming popular? [Michael K.]
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?
AbstractEntity
ApplicationConfiguration/JaxRSConfig
REST-Adapter/Interceptoren/Filter/Mapper
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
What’s your reaction to this post from Juergen Hoeller: https://spring.io/blog/2015/06/04/happy-second-birthday-java-ee-7-how-is-it-going-in-production Remko
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 question related to cooperation with JavaScript in one war. I would like to make a simple app using AngularJS but the structure of this project not directly match to the maven project so I found that I can use yeoman-maven-plugin and everything started work fine but then maven build takes too much time. I think that my approach is a little bit too much complicated :) So can you tell me how you do this, I will be grateful. Sebastian
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)
a) auto-increment / not auto-increment ?
b) table / sequence strategy ?
Question 4 : how to do audit in JPA ? masumcse1
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
Any questions left? Write a comment, edit: https://gist.github.com/AdamBien/ee8565840092cc7f39ab or ask live: https://twitter.com/AdamBien.
See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting