When I look at the commons-functor website website, it appears to be out of sandbox state, but it also says there is no official binary release? But I thought I saw it in some Maven repository somewhere and can't find it now. Does anyone know what the status is and whether there is an official binary release? I suspect I am just poor at navigating the Commons website.
Looks like the last development was three weeks ago (see this) and their "release notes" for 1.0 are just a skeleton (see here).
A couple quick searches show that Apache Commons Lang used to have a package org.apache.commons.lang.functor - but this was removed some time ago, it seems (like 2003 or so)
As a side note, it appears that Apache Commons Collections has a package org.apache.commons.collections.functors - but this might not be what you're looking for.
I have absolutely no idea what the release or maintenance state of this library is. My apologies.
But what i do know is that the world needs another functional programming library for Java like it needs a hole in the, er, head. Ozone layer? There are already quite a number in circulation - Functional Java, the functional parts of Guava, LambdaJ, and others - all doing much the same thing (or at least having overlapping bits doing much the same thing). What we need to do now is to start coalescing our attention around two or three of these libraries, developing common styles and idioms for using them.</rant>
At the company where i work, where there are a lot of big fans of functional programming, we seem to have settled on Functional Java, having had LambdaJ, Guava, and a couple of homebrewed functional frameworks in our codebase (and having rewritten bits of it in Scala!). That decision was made by people with deeper understanding of functional style than me, and before i joined the company, so i can't explain the reasoning, merely report that it was made. Functional Java is actively developed, and it's in Maven. I would urge you to have a look at it, and see if it meets your needs.
Commons Functor is heading toward it's first official release. You can give it a try by using the nightly snapshot from the Apache repository:
https://repository.apache.org/content/groups/snapshots/org/apache/commons/commons-functor/1.0-SNAPSHOT/
Related
Weird title, I know, let me explain.
I am a developer most familiar with C# and Javascript. I am completely sunk into those semi-functional worlds to the point that most of my code is about mapping/reducing/filtering collections. In C# that means I use LINQ just about everywhere, in Javascript it's Underscore.js and jQuery.
I have currently been assigned to an ongoing Java project and am feeling rather stifled. I simply do not think in terms of "create an array, shuffle stuff from one to another". I can (and did) create my own versions of the main map/reduce functions using anonymous types implementing interfaces but why re-invent the wheel? The project I am currently on already has commons-collections-3.1.jar and looking through the classes contained it seems like it likely can do everything that I want and more.
For the life of me, I can't find how to actually use it. Looking through the dozens of classes therein is not very helpful and the only thing I can google up is the api doc which is equally as helpful.
How do you use it to Map/Select, Filter/Where, Reduce/Aggregate? Is there anywhere that gives an actual tutorial on this library?
(Comment as answer for formatting purposes.)
Not so much, other than the limited user guide.
That said, I'm not sure where specifically you're having problems--filtering and selecting is mostly wrapped up in the functors package, and utilized by the CollectionUtils class.
While you're not looking for a replacement, you might find things like Guava or Lambda4J a bit more similar to what you're used to (within Java's constraints), and they're a bit less verbose.
Try these links :
http://commons.apache.org/collections/userguide.html (basic tutorial)
http://larvalabs.com/collections/tutorial.html (advanced tutorial with generic)
#george-mauer, you might have to rely on articles like this or a book like Jakarta Commons Cookbook. I have also found it rather useful to learn by creating samples of my own.
The last time I did any serious Java coding was back around the turn of the century. In the mean time I've been doing a lot of other stuff, most recently c (embedded stuff) and c++. I'm starting on a new assignment in a couple of months and it will most likely be all-Java-all-the-time. I don't much info other than that I will be dealing with JBoss for some applications.
So, I would like some suggestions on books/site/whatever to at a minimum get me buzzword-compliant and hopefully give me a good handle on the state-of-the-art in the world of Java.
Thanks,
Cesar
I was in a similar situation a year ago, and this book was the most useful: JBoss At Work. You will start from a simple web page, and then build toward a WebService with JPA, JMS, JTA, EJB etc. So you really code instead of just read -- it helped me to get to speed very quickly. Highly recommendable.
The only downside is that AFAIK, there have been no 2nd edition, and a lot has changed since then... But I still recommend it.
For changes in JavaSE (particularly those new things since Java5), Effective Java 2nd Edition. Period.
An overview of jboss related projects you find here: http://www.jboss.org/projects/matrix
I'm afraid that you will be buried in information.
You should find out what technologies are used for your assignment.
I would suggest a roadmap like that:
Presentation Layer
JSF and Richfaces (which includes Ajax4jsf)
JSP
Seam
Business Layer
EJB (Message Queues,TimerBeans as well as annotations have been added)
Webservices JAX-WS, XML-Binding JAXB
Java Connector Architecture (JCA)
Rule Engines
Persistance
Hibernate is commonly used as an implementation of JPA
JbossCache could also be important if it's about performance
Build System
ant
maven
Testing Frameworks
SOA would be a another complex topic
Hope this helps
JBoss suggests Java EE, so I suggest Mastering EJB 3. Given your background I doubt you need to do much on the Java SE stuff.
+1 on Effective Java. Best money you'll spend on a Java book, for sure! Other than that, I'd encourage you to stay away from as many acronyms as possible... Most of them are only good for making sure the guy after you has plenty of work to do...
For getting a general intro into Java EE, I would recommend Java Enterprise in a Nutshell. This gives an overview of most of the relevant technologies, so you get an idea about what's what, and have a base to decide where to dig deeper.
Also JBoss in Action.
I would take a look at The Spring Framework, it is used in almost every Java project I know of.
Also, learn the new (now old though) language features introduced since last time you worked with Java, most of them introduced in Java 1.5 (generics, autoboxing etc).
Read through the JDK release notes / new features list for each release since then (at least, for 6 and for 1.5). Basic language functionality has improved. I can't remember 2000 exactly, but generics, autoboxing, annotation, enhancements to Swing, the Collections framework, instrumentation, for (obj:objs), and asserts are all language enhancements that jump to mind--and they are all detailed in release notes.
That'll at least get you through 2007 or so. ;) Past that, start looking into the frameworks mentioned elsewhere, and have a peek at the upcoming Java proposals for new features.
It may help immensely to download eclipse with spring tools and start playing with some sample applications.
I recently graduated in Computer Engineering. I don't have a permanent job yet. The recession is making a good difference in my aim and reality. I don't want to just sit down. I want to sharpen my capabilities. I want to learn and practice in a professional work environment.
Now my question is: What are the tools and practices followed in a professional working environment? I mean IDEs, team working tools,debugging tools, unit testing tools etc?
What are the frameworks in Java EE which are must-know, or which will bring me advantages in my job interviews?
Thanks in advance.
Some initial suggestions:
IDE: Eclipse or IntelliJ
Source code management tools like git, Subversion, Mercurial, CVS
JUnit for testing
Read "Code Complete", then sleep with it under your pillow. Maybe keep a copy in your bathroom as well.
IntelliJ is by far the best Java IDE, but it is commercial. Between Eclipse and NetBeans I would recommend NetBeans, it is closer to what an IDE should look and/or do(nothing against Eclipse, but I couldn't get used with it...maybe is just something wrong with me :) ).
You might find this poll (long but) interesting... http://www.java-forums.org/new-java/7315-what-you-using-write-your-code.html
We've been running a co-op (i.e. cadette) program for the last five (or so) years. Here's a list of stuff (in no particular order) that co-ops are clueless about that we really really wish they knew "the basics of" when they arrived:
Testing - Everyone tests, but (IMHO) few do so really effectively. Myself included.
Team development - How to work together on a codebase which is bigger than anyone.
Understanding legacy systems - Hey, this code is twice is my age? WTF?
Project management - That dark arts of delivering quality on time and on budget.
Business analysis - BA's are full of it! You at-least need to know enough to smell the effluent.
Known when to say NO - Practice saying this in front of a mirror: "No sir, I'm sorry, you really can't have this Ferrarri for the price of a second-hand mini."
The technology really is the easy bit. Having said that, your first position is likely to be as a code-monkey... so the more tecken ze spreken, the more likely you are to get a foot in the door.
So I suggest
Tackle the J2EE 1.4 Tutorial
... also look at a web-app MVC framework like Struts 1 or (better) JSF; and
... also look at Hibernate - the psuedo standard persistence layer.
... also look at "early" DHTML - manipulating a html-DOM with javascript.
... also look at Swing, Applets, but try not to drown in it.
then (and only then) tackle the J2EE 1.5 Tutorial (EJB3).
I'm still in the process myself. I've been at it for two months. Anymore than two hours at-a-time makes my brain hurt, a lot... you can teach an old dog new tricks, you just have to do it slowly.
Like already stated: Every position will have it's own technology set... two people sitting next to each other may use vastly different product groups. What I advise you to learn instead of "all the techs" is the process of learning technologies, and the considerations in selecting appropriate technologies to suit a particular problem, and organisation.
The best thing you can do to improve your chances of actually getting that job is to join a "Young IT Professionals" group (like this one in Australia)... they'll probably do a "mock interview" day... constructive criticism (as apposed to spoonfeeding) will improve your job applications, your CV, and your interviewability. Hanging-out with a bunch of people who shre your interests is informative, and fun. You'll miss that "brain stimulation" in the break between uni and IT work.
On the recession thing... I graduated B.Bus(Computing) a month after the dot-com bubble burst. I worked in a supermarket, drove a cab, delivered pizza, did some builders labouring, flogged PC's, vended bad financial advise to people who can't add-up for ${nameless_charlitans}, flogged anti-virus software, tutored at the local TAFE college, got a few short-term contracts writing software for a big accounting firm... then I started voluntarily fixing up the PC's at my local employment exchange (I was there waiting for appointments for hours-on-end anyway, and it was better than doing nothing)... The IT-dude there got me an interview with "a mate" (i.e. my job was never advertised), and the rest is history. Funny how stuff works out. I feel for ya', just please don't take the knock-backs personally... you're likely to get a lot of them... it's just how the game is played.
Cheers. Keith.
For the long term, work on an open source project. You'll learn a lot, and probably more quickly than you'd learn from a job.
My Java colleagues use this for most things.
Eclipse
Oracle or MySQL
Struts
Subversion
Bugzilla
JUnit
They also use Sun's Java Composite Application Platform Suite (JCAPS) for some things.
I think you need to take a close look at the companies you are applying to. The amount of "toolage" in the java world is way too much for you to become familiar with on your own in order to become attractive to any random employer.
I personally vote that the majority of it is overcomplicated crap, despite all the marketing hype that it gets. Find a company that looks like it works with stuff that you're interested in, find out what sort of stuff they use and then familiarize yourself with that. You probably won't be able to demonstrate job-level experience, but you will show yourself to be enthusiastic.
I'm going to go the route of suggesting what I feel are the most popular choices out there, which hopefully will give you more exposure to land that first job. Once you get your feet wet, I would recommend investing some of your free time to evaluate the other options out there. There is so much in the Java ecosystem to explore.
IDE: From people that I talk to, Eclipse seems to be the most popular. Netbeans is solid too but its future is in doubt since Oracle is working on acquiring Sun. A lot of folks swear by IntelliJ but I think it's much smaller community (and costs money).
SCM: Subversion and CVS are probably the most popular and Eclipse has built-in support for both.
Unit Testing: JUnit, it's the de-facto standard.
Builds: Ant, again the de-facto standard for build automation.
Frameworks: I would recommend either (1) Spring and Hibernate, the wildly-popular open source stack or (2) EJB and JPA, the Java standards. My personal preference is towards #1. As far as UI goes, there are a lot of options available, so it's harder to recommend. Struts and Spring MVC are more "old school" classic MVC frameworks whereas GWT and JSF are more "component-oriented" frameworks. You also have less popular ones like Wicket and Tapestry.
Assuming you can get your CV/resume read by someone and get an interview:
Get a copy of Effective Java by Josh Bloch, read it, memorize it and understand it. A lot of interviewers (and I have done more than my fair share) use it as a good source of techniques that people should know and understand.
In terms of tools - you can't go wrong if you know:
Eclipse
Spring
Hibernate
Ant/Maven/Hudson
JUnit
Log4J
These are all Open Source (and hence will fit anyones budget). Most Java shops will use at least one of these!
With below tools you can make sample/demo applications
IDE : JDevloper/Eclipse/Netbeans
Server: Tomcat/Jboss/Glassfish
Technology: Hibernate,Spring,EJB,Struts,Log4J,SLF4J,Hudson,Ant,Maven
Weblogic,Jetty,JBoss or Tomcat with
-Maven build tool (indirectly background Ant and library versioning)
-Prettify ("readify")
-Minify (spaceless)
-Refactoring (batch rename units)
-XML
-Stress test tool
Old tools e.g. rsync, emacs, awk, xargs, dd handle the largest files. less is good for streaming files (shift+F)
This really depends on the jobs in your area. I suggest you take an analytical approach.
Use a job search engine for you area and do keyword searches. This will give you hard numbers of job skills people are looking for in your area.
You may also find these pages useful 10 Hot Skills for 2009 The 2009 IT Salary Guide
Write an own homepage! It shows that you have fun when you write software (so you do it in your free time).
Build something you're interested in building and choose technologies that seem correct to do the job. At the same time, take the extra time -- as you should when working as well -- to use tools that might be a hassle but you think will bring you an advantage. Knowing frameworks like Spring or Maven or whatever may or may not be relevant. A good employer doesn't care what you know, but how you know what you know. Can you learn?
Use some note repository (like Evernote or my own, TheKbase :) and start making notes about your world. Whatever knowledge you have digested should be instantly retrievable and not based on your limited memory.
I was always interested in Swing and teaching, and strangely I got a job teaching Swing (which I knew a bit), but also teaching all kinds of stuff that I didn't know like Struts and XML security (you read the books and put in the time). Plus I taught IDEs, which I always liked even, though everyone thought I was an immature programmer because I wanted autocomplete :) Again, following preferences...
My point is that unless something about learning a framework or tool particularly appeals to you, don't bother learning it. On the other hand, if frameworks are particularly annoying for you (for me they have been), take the most annoying and daunting and build something with it. It's a rite of passage that most people do because an employer asks for it, which is too late, IMO.
You already have a good list of tools from the answers above. Here are a few things you could do to get more attractive to potential employers.
Participate in an Open-Source Project
To become a better programmer, learn
a language completely different from
Java. A good starting point could be
other languages on the JVM - Clojure
/ Scala.
Gain expertise in specific areas in J2EE that will make you stand out - security, performance analysis, etc.
Create your own website using the tools and the frameworks you have learnt
Currently, the XACML specification defines a protocol for request / response but leaves it up to interpretation as to how it can be integrated into an enterprise application. I believe that the value of XACML won't be realized unless there is the creation of a new open source project that attempts to develop/standardize around a set of common APIs.
For those who are familiar with XACML, I would love to understand their first reactions to creation of such a project, whether they would be willing to contribute and what they believe an XACML API would look like?
Maybe I don't understand the question, but doesn't the SAML profile for XACML do what you want? It defines SOAP formats for authzDecisionQuery and response records, which should be all you need for the WSDL.
I built one of these around Sun's interpreter for DOD/DISA (its on forge.mil), and a much faster version (not relesed yet) around a fully compiled implementation that directly transforms XACML into Java code. The main goal was readability, not speed, but its about ten times as fast.
IMO XACML works but is absolutely terrible as a language for people to look at. I'm more interested in finding a problem-specific language for expressing XACML's semantics so that people can understand them. Java beats XACML for this hands down, but Java's pretty clumsy as a domain-specific language. Perhaps Groovy?
PS: As our first shot at this we tried Attempto Controlled English (ACE). We quickly dropped that idea when we found ACE has nothing viable for expressing deeply nested conditionals (no parentheses or braces). And I'm not sure English was the right idea for this anyway, inspite of strong NSA interest in english-based policy languages.
Doesn't Sun's XACML Implementation give you a solid API?
http://sunxacml.sourceforge.net/
(The development is back on track and the site should be updated soon. Hava a look at the sunxacml-devl mailing list.
sunxacml is not actively maintained.
The last update on the page/implementation is from year 2006.
An actively maintained open source XACML implementation is the HERAS-AF XACML Core.
SAML profile for XACML and WS-XACML specifications are attempts to standardize the communication between XACML PEP and PDP. WSO2 Identity Server is an open source project and will adding this support by early next year..
Thanks...
WS-XACML is long dead unfortunately. SAML profile of XACML is today the only standardized approach but that's more about the communication than the ease of use of APIs.
At Axiomatics we did develop a simple SDK but it remains our fairly vendor-specific.
I know that there is a strong initiative called OpenAZ pushed forward by Oracle and Nextlabs. They are aiming at defining simpler APIs for PEPs. That is probably what you would want to look at.
Links:
Axiomatics simple SDK demo: http://www.youtube.com/watch?v=Z_2M775uFxo
OpenAZ: http://openliberty.org/wiki/index.php/OpenAz_Main_Page
James, I would seriously look at OpenAZ. There is a call every other week on Thursdays which you are welcome to attend.
Question from a C-guy who has to work with some java code that is connected to my C-code via JNI.
I have to work on the build-system, and I'm trying to change that from a shell-script to a proper makefile. For the C-part that's easy, but the java side somehow involves xdoclet stuff.
I haven't yet found out what xdoclet is all about, and I want to understand it all.
I did my Google research, but I have no idea what that thing does. For me it seems like you only have a chance to understand the official documentation if you're already familiar with the problem and you have 10 years of java work under your belt.
Could you please - for dummies - explain what does xdoclet does?
Btw - also I've mentioned C. I'm into object oriented programming as well. There is no need to explain the basics of classes or inheritance (if required to understand xdoclet) to me.
Edit: It's been for IT things roughly a decade ago that I've asked this question. I still have no idea what xdoclet is, but the question got over a thousand views. I would like to see some java guy to chime in and finally clear things up.
The 10000 foot view of XDoclet is that it's a code generation engine. IMO, the interesting thing about XDoclet is how it does what it does, as opposed to what it does.
There is a tool called javadoc that takes annotation in source code comments and generates html documentation with it. This is the classic example of what javadoc was originally designed to produce. In an effort to support different output formats, the authors of javadoc made it plugable -- you can write "doclets" that plugin into the javadoc engine. This allows them to leverage the same source code parser, and emit different documentation output.
XDoclet is a clever hack that uses this engine to do code generation instead of documentation generation.
An example of usage would be: the developer manually writes a class that contains business logic, adds a few xdoclet annotations to the javadoc, and xdoclet generates additional code that provides transactional integrity.
EDIT:
As erickson notes, Java 5 added support for annotations as a language feature that can be processed directly by the compiler. As a result, the functionality that XDoclet used to provide can now be performed directly by the Annotation Processing Tool (apt) that ships with the JDK. Because of this XDoclet is now generally considered to be obsolete.