Using SpEL (or any expression language) in Quarkus for object transformation - quarkus

I am trying to find out how to use SpEL (or any other expression language) in my Quarkus applications to handle basic object transformation via injected configuration (and run on Graal).
I am not sure if/what is possible here and I cant find much in the way of docs or how-tos.
I see that this can be possibly be used via the Apache Camel extension, but right now that would be overkill for this requirement.
Any pointers or guidance would be appreciated.
Thanks.
Not much - I cant find docs, examples or howtos for this anywhere.

This is not supported in core Quarkus

Related

OpenAPIv2(Swagger2) + GraphQL

We have built a REST service which is documented using OpenAPIv2 specification. We do code generation using swagger-codegen and build service on JAX-RS.
We are looking to add GraphQL to our existing REST service. Looking for best possible way to integrate GraphQL into existing OpenAPI(Swagger)v2 spec. Any help or directions is greatly appreciated. Thanks
This tools should be able to generate GraphQL from your spec:
https://github.com/strongloop/oasgraph
or at least provide a good starting point.

RMI/Proxy in ceylon and relation to non-default methods

I want to write an RMI library in/for Ceylon (since I have not found one so far).
The first thing I need is a proxy. In Java I used something like
Proxy.newProxyInstance(classLoader, interfaces, handler);
1. Is there something equivalent in Ceylon? (haven't found something)
Attempting to write something like this my own, I came across this solution for the JVM using byte code manipulation.
Nifty and exactly what I want.
Notice, that this can even produce a proxy for a class, not only for interface like in Java. In Ceylon this is should be legit, since there are no fields and we can simulate the whole class with method calls.
2. If creating proxies for classes is a no-go just tell me.
Also, what is the Ceylon intuition/future about proxies? Shall there be (no) proxies?
In a future with proxies we have one major problem:
In Ceylon we have the default keyword, without it a method can not be refined/overwritten. This also results in final methods for the compiled Java output classes. Thereby (not even) the byte code manipulation can overwrite those and redirect them to an invocation handler/interceptor.
3. How do we deal with this?
I assume not at all? I totally get the idea of disallowing the refinement of methods and the default/final keywords, but this obstructs RMI/proxies for classes.
4. Are proxies for classes a bad idea?
And yes, there are so much more questions I am currently thinking about and investigating on: JS implementation, interfaces and default methods, etc
These points seem to be the most relevant at the moment, so let's start here.
You could try using this module I wrote:
https://github.com/gavinking/ceylon.proxy
Alternatively, if you're only targeting the JVM, you could just use Java's Proxy directly.
During further research I found:
1. Proxies are currently part of the Ceylon 1.4 milestone (issues regarding proxies).
3. Enabling EE mode for the ceylon compiler, removes the final keyword.
From this point on the solution I found works like intended and is exactly the same as the one provided by Gavin.

spring data neo4j - using server extension through repository

I read about the server extensions available in neo4j in server mode. I was wondering if it is possible to somehow annotate repository method to use this extension insted of allowing to create query based on method name or #Query annotation?
If not, is there easy way to invoke REST interface methods using Neo4jTemplate?
That's not possible right now, it would be cool though, feel free to raise a JIRA issue that describes your suggestion in more detail. Perhaps Spring-Data-REST Clients allow such a thing.

Use of Spring oxm

I am new to spring. I was looking into spring-oxm's XStreamMarshaller. I was hoping to find a way to convert my objects into xml using this. The spring site tells me clearly how to do it but it still needs me to add a XStream dependency in my POM. I don't understand what the use of spring-oxm is? If i had to add the xstream dependency anyway then i can directly use xstreams toXml operation and be done with it? I would really appreciate any help I could get in understanding the use of spring-oxm.
Thanks a lot in advance!
Spring provides a higher level abstraction for you by eliminating the scaffolding code you need to write. For e.g. in case of OXM you will be working with Marshaller and Unmarshaller abstractions irrespective of the underlying implementations uses (XStream, JAXB, Castor, XmlBeans etc). Moreover it lets you use DI for injecting marshalling/unmarshalling services to your own services. Another advantage is consistent exception hierarchy irrespective of the underlying implementation. All these are well explained on their reference documentation.
If you have very simple needs and doesn't already use Spring then I suggest you stick to JAXB that comes with JDK 6.

Learning Spring MVC For web-projects

I have looked at Spring MVC a few times briefly, and got the basic ideas. However whenever I look closely it seems to require you already know a whole load of 'core Spring'. The book I have for instance has a few hundred pages before it gets onto Spring MVC... which seems a lot to wade through. I'm used to being able to jump in, but there's so much bean-related stuff and XML, it just looks like a mass of data to consume.
Does it simplify if you put the time in, or is Spring just a much bigger framework than I thought? is it possible to learn this side of it in isolation?
#John Spring just a much bigger framework than I thought? - probably so, at least I thought so.
is it possible to learn this side of it in isolation? - Yes , here is a good way to learn your way http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/spring-web.html
And also I'd recommend you read a book manning spring in action 2nd edition, I also was learning spring from zero, and now I'm comfortable with it after reading this book, of course you have to refer to reference every now and then.
Here is where you can get basic info about MVC concept if you are not already familiar with(its in php, but important thing is point not syntax)
http://net.tutsplus.com/tutorials/other/mvc-for-noobs/
EDIT
If you want to see MVC in action, with examples or other spring uses use this repository https://src.springframework.org/svn/spring-samples to checkout some projects , you'll see mvc-basic, mvc-ajax ..etc this is really good resource , you can checkout projects with Tortoise SVN on windows or subeclipse from eclipse
At least you need to understand the core Spring - dependency injection, application context configuration and so on. It's actually not too complex, just a bit hard to start. For an experienced developer it might make sense to take a look at some sample app for the basic setup.
ps. I've got this sample project for JSF/Spring/JPA/Hibernate combination. Not Spring-MVC, but may be still helpful.
I myself am trying to learn Spring MVC from NetBeans official documentation from here:
http://netbeans.org/kb/docs/web/quickstart-webapps-spring.html
Coming from ASP.Net/C#, it feels like there are so many steps to do in that simple example.
The great thing about Spring is that you can pick and choose what you use. If you want to use Spring, you don't have to jump in head first, you can just try it out by, say, using the Dependency Injection features, or by using the JDBC Template stuff. My recommendation would be to start small, and see how you like it.
To use the Web MVC stuff, you will need to understand Dependency Injection for configuring your controllers. You can choose to use the older more flexible XML-style configuration, or you can use the newer Annotations. Or you can mix and match. Starting with XML would probably be best as it will help you understand how stuff is working (it'd be like learning C and C++ before Java). Then you can move to using Annotations. Personally, I use XML to instantiate all my beans. I use the #Autowire annotation to inject dependencies. This seems to be the sweet spot for most flexibility and ease of use.

Resources