Examples and Documentation for Apache Deltaspike - where are they? - java-ee-6

I followed the path of Java EE for quite a while now, used JBoss Seam and followed its standardization within CDI.
Now after trying to solve the first steps on the hard path from Seam 2 to 3 migration, I learned that all was moved to Apache Deltaspike.
But while Seam was decently documented and equipped with examples, Deltaspike is not. There are menu items leading to "Documentation", which is very poor, littered with TODOs and without any visible structure and to "Examples", which is more or less a joke.
Ever since I tried to step up to Java EE 6, I feel a bit like standing in the rain - even though it's great, that many concepts of Seam 2 went into the standard, I miss many things I had before - and exactly those things should be covered by CDI extensions. Here again, it's great that there is a common effort to channel those extensions in a project like Apache Deltaspike - but at the moment there is a very high hurdle to get benefits from it, even if you're not a beginner in the technology.
So - can anyone lead me to decent resources, documentation and examples how to use and understand the CDI extensions?

As noted in other responses, the DeltaSpike documentation is a little lacking. You could always take a look at the tests and javadoc. For examples, I think you'll find JBoss jdf quickstarts to be the best location for examples currently. Do a search on the right for DeltaSpike and you should see around seven examples.

DeltaSpike is still early in its development. It is only at version 0.3; it might be quite some time before it's production-ready. Until then, you might take a look at MyFaces CODI or Seam, two projects whose development has halted as they are presently being merged into DeltaSpike.
The documentation at the DeltaSpike web site, I agree, is quite insufficient for users; I bet it's just for people that want to test it out or develop for it.

Here's a concrete example. I am a reasonably experienced software person. I would like to use DeltaSpike BeanProvider.getContextReference to inject an EJB into some code that is not itself an EJB. I included the requisite Maven dependencies and added the BeanProvider.getContextReference code to one of my classes. I'm getting error messages that tell me that DeltaSpike is not configured. Two hours with the documentation did not get me any closer to understanding what I need to do simply to turn it on. What seems to be missing is a "How to configure DeltaSpike core." page.

Related

Download Scala and Spark API docs?

Seth's comment below listing a URL in the maven repo, seems to be both correct, and general. Following the logic, I also found the spark docs at:
http://repo1.maven.org/maven2/org/apache/spark/spark-core_2.10/2.2.1/spark-core_2.10-2.2.1-javadoc.jar
Which means that in effect my question is answered, but since Seth didn't give an "answer" I can't mark it as such. Not sure what to do about that!
----------------- original question below -----------------
I fear I'm being unobservant or obtuse, but I have been unable to find where I can download the API docs for Scala, and also for Spark. I know where they are online, and I suppose I might try a recursive "wget", but I'm leery of that since I'm not sure I could get it to produce anything that works locally anyway. Perhaps I need to build them locally, but that too seems like a lot of effort since I can't quite believe these resource don't exist in a ready-made form.
In case this seems like a stupid request, I spend half my life on the road, on aeroplanes with expensive, low quality, (and theoretically unnecessary!) internet connections, or in the middle of nowhere, so I'm in the habit of installing all my tools and resources, particularly including API docs locally. That was easy with Java, but not so obvious with these two technologies.
Can anyone tell me where to find a downloadable package for each, or if I do in fact have to use one of the techniques I mentioned in my opening paragraph?
Seth, who made the first comment under my original question nailed this. I'm adding this essentially so that the question shows as answered.
In summary:
Both documentation sets are downloadable from the maven repositories:
http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.4/scala-library-2.12.4-javadoc.jar
and
http://repo1.maven.org/maven2/org/apache/spark/spark-core_2.10/2.2.1/spark-core_2.10-2.2.1-javadoc.jar
It appears that this is a general observation that's likely applicable to many if not most packages that maven has to offer.

Silex vs SLIM PHP Framework

We have narrow down our search between Silex and Slim PHP frameworks for routing our REST APIs on our Apache/PHP/MySQL Server.
Both seem to have good reviews. Silex has probably a bigger community because it came from Symfony. But the documentation seems to be better in Slim.
What do you guys suggests? Any real world experience from production environments?
Sathish
I had the same choice to make, and I choose Silex, here is why :
Silex seems to have a bigger community than Slim, maybe it's just my point of view
It's based on Symfony components, so with a bit of reflection, you can use tips and workarounds which work for Symfony and apply them to Silex.
As it's based on Symfony it has a better integration with other bundle (for example Twig, which is for me necessary)
This Symfony base also garanty that it will be more "Long Term Support" that Slim, which is independent.
To conclude, the main argument is that is based on Symfony which has many advantage.
The Symfony Debug tools are the best thing on earth !!
Now I have two sites made with Twig and I'm really happy !
You can also see that, it's a technical comparison of these both frameworks :
https://michalzuber.wordpress.com/2015/04/02/silex-vs-slim-php-microframework-comparison/
Slim 3 is very light weight and well suited to APIs.
You can optionally inject a container (Pimple by default but any Container-Interop will work) when constructing your Slim app. The Silex app extends Pimple so is a container.
Require slim/twig-view if you need Twig.
Slim's Request and Response support PSR-7 HTTP message implementation.
On January 12th 2018, Fabien Potencier, main author of this micro-framework, wrote that Sensiolabs stops supporting Silex.
https://symfony.com/blog/the-end-of-silex
Quote from Silex official site:
Silex is in maintenance mode. Ends of life is set to June 2018. Use Symfony 4 instead. Read more on Symfony's blog.
Slim is better if you want to create apis as its light and fast. Hence slim provides you the DI and routes it is much more flexible to use your own libraries or plugins from laravel or symfony or any third party.
For example you can use sentinel from laravel for auth
TL;DR Choose Slim 4. "At its core, Slim is a dispatcher that receives an HTTP request, invokes an appropriate callback routine, and returns an HTTP response. That’s it.". That should be it.
Late to the party but nonetheless here's my 2 cents(!) on the topic especially for future-googlers about this topic (even though Silex has reached end of life); I'd go for Slim. Which I already did on my previous 2 projects and it never let me down. Before the "here's why" part I'd like to share my background in a nutshell; I've worked with CakePHP and Laravel (especially >=5.4, <5.8) (and also with Lumen) years and years ago, right before I introduced myself with Node.js. Since then almost all my work runs on Node.js in the cloud. Now there's Golang on the table... but that's another story. Due to the requirements (or I should say constraints) of the aforementioned 2 projects, I have to write PHP. Since all those years past with Node.js I suddenly realized that I've forgotten about PHP almost completely. But there were 2 things I remember crystal clear; I've suffered. A lot. Because of those frameworks.
Don't get me wrong former is the eldest one and the latter is the hipster of the pack, I respect them, their authors and their community. Everything has a reason to exist. But one is behemoth and the other one is magical (both not in a good way - I mean did you ever try to debug the Laravel with those facades and static methods and stuff?). OK I hear you, they are frameworks and they should do things for you (have you heard of Hollywood Principle), not everything for you. What this does mean to me is that they always whispering to your ear "our way or highway" (sometimes even yells). "Surely you can do this (say push a job to a queue, query your database, send email, etc.) but first do this, and then that" (maybe couple of more steps but this is not that bad). The bad thing about this is (not accusing anyone) I don't know what do they mean to the framework. They must do something meaningful, obviously though, I don't know what it is. Should I know? Yes, of course. I'm writing this application with that framework for God sake, I should know what it does. Version X was easy to grasp, but what about version Y, Z, T... Have you seen the version dropdown on the Laravel's documentation site? I took those steps because I've been told so. Again that's OK, fair is fair, those steps makes me achieve something far greater. But gradually I'm in their (respective authors') control. After that, even small change takes lots of searches on SO, GitHub issues, Google... Sometimes ends up with a success and most of the times don't. Either way the war against the framework must be declared.
In my point of view this is not how an open-source framework should be. I am vendor locked-in in some sense. Maybe I want to adhere PSR (not that because I'm an advisor recommendation freak, because PHP-FIG is a well-known group with standards almost for every aspect of the language - this is important; for the language, not for any framework). Let me ask you something; do you use Composer? If so why? Because it's standard (I'm not sure if it is)? Because everyone uses it? Because the needed package of yours recommends this way of installing? Actually the answer doesn't all that matter, at the end of the day you use it. And you can use it practically for every PHP framework/project. The Composer requires you to have PHP installed on the system at bare-minimum and coincidentally it's the only requirement. This is freedom, and I want that. I want to pick and choose a router or a container for my taste. Today this package, later something else.
Slim gave me that freedom, especially on version 4. It's community is small, it's foreseeable; it does so much less than the other, full-blown frameworks. Actually it's a micro-framework (although I wrote an MVC application and REST API server with it). Other packages' communities are what matters right now. You need a container, composer require php-di/php-di. Now think about it's community, since "your" application (hence the framework) is a part of it. You have a problem? Ask for help specifically for that package. Maybe someone using another framework (or someone using no framework at all - if there's any left nowadays) might help you with your problem. So you've gone framework-agnostic thanks to your setup. Don't you like PHP DI, well find yourself another PSR-11 compliant package. Same applies for almost every part of Slim - except the router (Nikic's FastRouter should ring a bell), although it's already a foundation for other routers I see so far.
Before I finish I should say that too, Lumen and Silex has big brothers. I've been through a handful of frustration moments with Lumen; when I say "I can't do [fill here with a not-so-common problem] with Lumen version X.Y" they say "Use Laravel instead, it is really easy to upgrade". It should be for God sake! They share the same blood. I wasn't ask for that. If I were like to use Laravel I would choose it in the beginning and not use the Lumen in the first place. There were some reasons I did choose Lumen, like there were some reasons the author write it too (which I don't know why, but still...). Lumen should be a lighter weight, micro-framework alternative to Laravel, not a stepping stone.
Choosing Slim has it's disadvantages too but I think it's about the perception. I want to know what's happening on my application given the circumstances. Isn't reasoning about actually that? Even if I'm going to this rocky road at least I know at the end my application will do exactly as I commanded, nothing more nothing less.
Thank you for your time and please excuse me for formatting.
The fact that Silex didn't support PSR-7 (at the time of writing this) a huge let down. It has so many good point already mentioned above. There is a plugin/extension that let you do that, however I don't see the point in adding this overhead when you are looking for a lightweight framework

What is the best JAX-RS library?

I've been trying to choose which technology to use for a REST application and have found 4 candidates:
Jersey - jersey.java.net
Apache Wink - incubator.apache.org/wink
RESTlet - www.restlet.org
RESTeasy - jboss.org/resteasy
but haven't been able to differentiate between the four and choose one
so, which is best? the criteria s being:
a. Stability \ maturity
b. Security
c. Ease of use
d. Support
Thanks!
Rather than comparing I can give a definite picture about Jersey on your concerns. Firstly I am using Jersey for some time now (from its inception actually). The reason I still stick to Jersey is -
It is a matured project with a lot of test case and has been around for some time. I hardly found issues with Jersey and find it quite stable. I would say the project and its community are both matured enough to use it in production.
We are using Spring Security 2/3 with Jersey so I guess anything could be used on it.
To be honest I stick to JAX-RS stuffs as much as possible so I think its as easy as JAX-RS is. The only additional stuffs I use specific to Jersey is form data multipart, jersey client and jersey apache client. These are easy enough that I write a generic restful client for resources and a jersey client using client side HTTP Caching using HTTP Cache 4J. So I would say its pretty easy. Plus there are plenty (for my cases) tutorials, books, examples, blog posts, I hardly ever remember being stuck with anything.
Well, one of the primary reasons for me to never thinking of moving away from Jersey is its support. Paul Sandoz, the project lead of Jersey is just awesome support personnel in the mailing lists. I have rarely seen a topic in the mailing list where Paul does not help. In addition there are other members in the mailing list who are very eager to help out. The mailing list support is very good. The release cycle is short ensuring that bug fixes are available in short time.
All in all I am pretty happy with Jersey.

Risk evaluation for framework selection

I'm planning on starting a new project, and am evaluating various web frameworks. There is one that I'm seriously considering, but I worry about its lasting power.
When choosing a web framework, what should I look for when deciding what to go with?
Here's what I have noticed with the framework I'm looking at:
Small community. There are only a few messages on the users list each day
No news on the "news" page since the previous release, over 6 months ago
No svn commits in the last 30 days
Good documentation, but wiki not updated since previous release
Most recent release still not in a maven repository
It is not the officially sanctioned Java EE framework, but I've seen several people mention it as a good solution in answers to various questions on Stack Overflow.
I'm not going to say which framework I'm looking at, because I don't want this to get into a framework war. I want to know what other aspects of the project I should look at in my evaluation of risk. This should apply to other areas besides just Java EE web, like ORM, etc.
I'll say that so-called "dead" projects are not that great a danger as long as the project itself is solid and you like it. The thing is that if the library or framework already does everything you can think you want, then it's not such a big deal. If you get a stable project up and running then you should be done thinking about the framework (done!) and focus only on your webapp. You shouldn't be required to update the framework itself with the latest release every month.
Personally, I think the most important point is that you find one that is intuitive to your project. What makes the most sense? MVC? Should each element in the URL be a separate object? How would interactivity (AJAX) work? It makes no sense to pick something just because it's an "industry standard" or because it's used by a lot of big-name sites. Maybe they chose it for needs entirely different from yours. Read the tutorials for each framework and be critical. If it doesn't gel with your way of thinking, or you have seen it done more elegantly, then move on. What you are considering here is the design and good design is tantamount for staying flexible and scalable. There's hundreds of web frameworks out there, old and new, in every language. You're bound to find half a dozen that works just the way you want to think in your project.
Points I consider mandatory:
Extensible through plug-ins: check if there's already plug-ins for various middleware tasks such as memcache, gzip, OpenID, AJAX goodness, etc.
Simplicity and modularity: the more complex, the steeper the learning curve and the less you can trust its stability; the more "locked" to specific technologies, the higher the chances that you'll end up with a chain around your ankle.
Database agnostic: can you use sqlite3 for development and then switch to your production DB by changing a single line of code or configuration?
Platform agnostic: can you run it on Apache, lighttpd, etc.? Could you port it to run in a cloud?
Template agnostic: can you switch out the template system? Let's say you hire dedicated designers and they really want to go with something else.
Documentation: I am not that strict if it's open-source, but there would need to be enough official documentation to enable me to fully understand how to write my own plug-ins, for example. Also look to see if there's source code of working sites using the same framework.
License and source code: do you have access to the source code and are you allowed to modify it? Consider if you can use it commercially! (Even if you have no current plans to do that currently.)
All in all: flexibility. If I am satisfied with all four points, I'm pretty much done. Notice how I didn't have anything about "deadness" in there? If the core design is good and there's easily installable plug-ins for doing every web-dev 3.0-beta buzzword thing you want to do, then I don't care if the last SVN commit was in 2006.
Here are the things I look for in a framework before I decide to use it for a production environment project:
Plenty of well laid out and written documentation. Bad documentation just means I'm wasting time trying to find how everything works. This is OK if I am playing around with some cool new micro framework or something else, but not when it's for a client.
A decently sized community so that you can ask questions, etc. A fun and active IRC channel is a big plus.
Constant iteration of the product. Are bugs being closed or opened on a daily/weekly basis? Probably a good sign.
I can go through the code of the framework and understand what's going on. Good framework code means that the projects longterm life has a better chance of success.
I enjoy working with it. If I play with it for a few hours and it's the worst time of my life, I sure as hell won't be using it for a client.
I can go on, but those are some primary ones off the top of my head.
Besides looking at the framework, you also need to consider a lot of things about yourself (and any other team members) when evaluating the risks:
If the framework is a new, immature, "bleeding-edge" framework, are you going to be willing and able to debug it and fix or work around whatever problems you encounter?
If there is a small community, you'll have to do a lot of this debugging and diagnosis yourself. Will you have time to do that and still meet whatever deadlines you may have?
Have you looked at the framework yourself to determine how good it is, or are you willing to rely on what others say about it? Why do you trust their judgment?
Why do you want to use this rather than the "officially sanctioned Java EE framework"? Is it a pragmatic reason, or just a desire to try something new?
If problems with the framework cause you to miss deadlines or deliver a poor product, how will you talk about it with your boss or customer?
All the signs you've cited could be bad news for your framework choice.
Another thing that I look for are books available at Amazon and such. If there's good documentation available, it means that authors believe it has traction and you'll be able to find users that know it.
The only saving grace I can think of is relative maturity. If the framework or open source component is mature, there's a chance that it does the job as written and doesn't require further extension.
There should still be a bug tracker with some evidence of activity, because no software is without bugs (except for mine). But it need not be a gusher of requests in that case.

Advice for Beginners (Eclipse & Web Application)

I am about to start on a college project (a web application) and I have never used a full-fledged IDE such as Eclipse.
Turbo C/C++, Visual Basic 6,Java Basic, a bit of SQL, ASP, etc is the sort of exposure I have.
What things should I keep in mind before starting my project using Eclipse? Are the tools mentioned appropriate for the project?(If not please give a detailed answer)
Designing - UML (Rational Rose)
Language - Google Web Toolkit
Server - Google App Engine
IDE - Eclipse
Version Control - Subversion or Mercurial?
I would definitely recommend Googling first. There are a number of tutorials regarding Eclipse as it is a very popular IDE. A quick Google search of my own brought up all these results: developing web applications in eclipse
As for other things to consider, if you are developing a web application, you'll need:
web server (Tomcat is a popular one)
possibly a database (MySQL is an open source, easy to use DB)
language (I'm assuming you're going with Java since you are using Eclipse)
Of course, you'll also need to consider how you hook everything together and what technologies you want to use to do that. (Hibernate, Spring, etc) Eclipse itself has a ton of plugins to help bring together all these various aspects.
That list from Wikipedia is a good and comprehensive list, but if you are learning or developing on your own machine, you may not necessarily need all of that.
Hope that helps.
Since it is a web application, then start with the looks of it.
First, layout a template of how your pages should look, that is what users see. If it does not look good, the users will think the application (in its entirety) is also not good (it does not matter if the code behind the view is perfect; it will just make a first bad impression).
Start with that and be consistent with the design in all your pages. SiteMesh is a nice tool to dissociate the looks of the page from the functionality you put in it.
Then think what the application will do and what it will use:
you have a database? (use something like MySQL). With what are you going to access it? (IBatis is nice; Hibernate I think is a bit heavy weight for a first project)
you need a server: Tomcat is easy to use;
are you going for a simple Servlet/JSP approach or you want to use a framework (look at Spring or Struts);
try to find the good ways of writing the application, look at service layers, DAO pattern, DTO, MVC. Also, you must understand how HTTP works.
A lot more could be said.
Ah.. and also use a source repository. It’s a must (even if you work alone on this project).
Eclipse can handle all of these tools, but then so can Netbeans.
For your first project with GWT you should read through this tutorial:
http://code.google.com/webtoolkit/tutorials/1.6/gettingstarted.html
If you don't know Java then you will have some learning to do, and unlike Visual Studio your UI won't be just drag and drop, so it will be a bit harder than you are used to.
Subversion is fine, it is a nice source control, and any IDE will work with it.
Depending on your project would determine if GWT is the best choice though.
I expect UML may be overkill, and if you were following an agile methodology you wouldn't use it.
Your best bet is to get the UI done first, just have it appear as you want, and have some fake results, until you are happy with the look and feel.
Then, start to do the wiring to whatever you need on the backend.
Don't mean to be harping on you, but is Eclipse a must? For myself, in the beginning NetBeans turned out to be a really painless introduction to getting a web project up a running fast. I believe in the beginning one will spend a lot less time fighting the IDE with NetBeans.
A lot of the items from your bullet list NB makes super easy to ramp up as well. Just my $0.2