Optional Fun with Java 8

So, in my primary personal project, I've found a need for a data structure whose implementation is much like a linked list. Having run into the new (as of Java 8) Optional class by way of Stream this seemed like a wonderful excuse to look into it further. Optional is simply a class wrapping a reference that may or may not be there, for cases in which that references absence is not an error. It leverages Java lambdas to allow for code that doesn't care so much whether it is there or not, or is at least minimally obtrusive in that regard.
Read More

Rack of Lambdas

So, over the last few months I've been hard at play with a personal project. This has given me latitude to fool around with various things I find interesting (more to come) the first of which was to upgrade to Eclipse 4.5 and Java 8 (jdk 1.8). The main driver behind this was to fool around with Lambdas in Java, since I'd been using the C# equivalent by day. A little thought (well, actually, just paying attention to myself saying to myself "Self, this is pretty annoying") provided me with a couple of opportunities to use this language feature.
Read More

Recap of Microservices for Java Architects Presentation CJUG

on 4/29/15 1:24 PM By | Michael Hoffman | 1 Comment | Javascript Java Software Development Microservice
  I had the pleasure of attending the Chicago Java Users Group (CJUG) for a presentation by Derek Ashmore. The topic was Microservices for Java Architects. Over a two year period, I was part of the implementation of a system that had similarities to the Microservice Architecture approach, so my intention for attending was to hear Dereks' opinions on the topic. I also hoped to have some of my open questions answered around the topic.   To start, if you are unfamiliar with Microservices, I recommend to check out Martin Fowler's article here:  http://martinfowler.com/articles/microservices.html.      Overall, Derek did a great job of covering key Microservice Architecture concepts. I particularly liked his analogy of a stereo system for the structural concept of smart endpoints and dumb pipes. One of the drivers for Microservices is to address the concerns of a monolithic application. Derek addressed the monolith and then dove into a comparison of the monolithic architectural structure and the Microservice architectural structure. Next, Derek dove into design considerations and patterns. A few of the key patterns included Circuit Breakerand Retry. Derek covered how Microservices can be packaged, including a focus on Docker. He also covered several key cross-cutting concerns, including transactions, security and testing. Finally, Derek provided several considerations that are important when deciding to use Microservices for your architecture.    During the follow on discussion we shared our collective experience on the following areas:    1.  One of the key Microservice aspects I've researched is the need for DevOps, which Derek highlighted a bit following one of my questions. Microservices generally go hand in hand with lean engineering, which has the principle of releasing more frequently through a build-measure-learn cycle. Given this, it was his opinion that DevOps are really an important part of going with this architectural style.    2.  Another key aspect was around team organization. It was Derek's opinion that the team should be organized differently around a Microservice structure. He provided some sizing considerations for a team as well.    3.  The final aspect I got more information around was his opinions on security. I felt he went into a lot of good detail on how to address this concern. He also hit on an anti-pattern that I have seen several times in my research, which is exposing Microservices directly to the browser.  Many thanks to Derek for this overview - the key opinions in his presentation confirmed what I have both in both my research and experience. He hit on the concepts of governance. He went into a lot of detail on database considerations, especially the concerns of two-phase commit in the approach. Overall, it was a very useful presentation in terms of content and I came away knowing more about Microservices than when I started.
Read More

EJB3 vs. Spring: Rest Services

  Which framework is better? If you anyone has ever asked you if you prefer pizza or ice cream, you probably answered “Well… it depends”.  While frustrating, this is often the correct answer when asking which software framework is “better”.  So it is when comparing the Spring Framework with the capabilities provided by an EJB3 container.  I have decided to start exploring this question myself, in particular the functionality where EJB3 and the various Spring modules overlap.
Read More

Future-Proofing Java Data Access - DAO Pattern Done Right

Introduction When it comes to writing software at an enterprise level, most established developers are familiar with a variety of different approaches to accessing data.  In the most common case, a database houses the data that needs to be accessed. Different techniques such as result sets and object-relational mappings have typically provided effective ways to approach data access.  With all of these different techniques, should a developers approach for exposing methods to access data change if the data source is not a database; such as a web service or a product API?  The answer is NO; it should not matter what type of data source is being accessed if the DAO pattern is being used properly.
Read More

[Video] Introduction to Spring MVC

on 1/24/15 11:23 AM By | Naveen VK | 0 Comments | Java Open Source Software Development
Please check out the "Intro to Spring MVC" presentation that I gave at the Code Chix meetup in Madison, WI.
Read More

NVISIA's Naveen VK Presents on Spring Boot at Code Chix in Madison

on 1/22/15 11:28 AM By | Mark Panthofer | 0 Comments | Java Open Source News
On January 22nd, Naveen VK presented on Spring Boot to the Madison Chapter of CodeChix.  
Read More

Upgrading Open Source Frameworks – Part II

on 10/14/14 9:51 AM By | Erik Gfesser | 0 Comments | Java Open Source Software Development
In the first part of this series of blog entries, we discussed Spring Framework and Hibernate upgrades, and an XDoclet migration, all of which were performed for a recent client to decrease time-to-market, increase maintainability, maximize system lifetime, and maximize framework lifetime. In this second part, we start taking a more detailed look at the implementation details behind this architecture effort.
Read More

Upgrading Open Source Frameworks – Part I

on 10/14/14 9:48 AM By | Erik Gfesser | 0 Comments | Architecture & Design Java Software Development
Just recently, I created a series of proof of concepts for a client that concentrated on making components of a system available across the enterprise. The route chosen for these proof of concepts was Web Services, and the SOAP stack used was Apache CXF v2.1.3. In addition to the introduction of Web Services, upgrades of several open source frameworks were also performed, most notably Spring Framework v1.2 to Spring Framework v2.5.6, and Hibernate v3.0.5 to Hibernate v3.3.1. In addition, a migration from XDoclet v1.2.3 to XDoclet v2.0.6 (Codehaus) was also performed.
Read More

OSGi Tutorial

on 10/14/14 9:21 AM By | Jim LoVerde | 0 Comments | Java Open Source Software Development
There is a great OSGi for Beginners tutorial on TheServerSide. You’ve probably been hearing more and more about OSGi recently and if you haven’t had the changes to research it, you’re probably wondering what the heck it is. So here’s my take on it in a nutshell: OSGi is like Linux RPM for Java applications today, and will probably be like apt-get tomorrow. OSGi Today
Read More

Spring Framework 2.5 RC1 Released

on 10/14/14 9:19 AM By | Jim LoVerde | 0 Comments | Java Open Source Software Development
In case you haven’t heard, the Spring folks recently announced their 2.5 RC1 release. Some of the more notable improvements include: annotation driven dependency injection support and the ability to scan annotated components in the classpath – lots of ideas taken from Guice for this, has to potential to significantly cut down on and/or eliminate Spring configuration files, and we can finally lay XDoclet to rest
Read More

Enunciate - Articulate Your Web API

on 10/14/14 9:17 AM By | Jim LoVerde | 0 Comments | Architecture & Design Java Software Services Open Source
I’ve mentioned this is passing to a few people, but there’s an interesting little project called Enunciateout there that looks extremely interesting for developing web services. It’s sort of a meta framework in the sense that it allows you to define your web services as annotated Java POJOs and then it internally uses multiple other frameworks to expose those web services with features like: Full user documentation Consolidated, annotated WSDL(s) referencing a common set of schemas The same endpoint(s) published via SOAP, REST, JSON, and GWT-RPC Client-side libraries for download (JDK 1.4, JDK 1.5, GWT, etc) All packaged in a single war (docs, client libs, implementation code, etc)
Read More

Spring as the New Java EE

on 10/14/14 9:16 AM By | Jim LoVerde | 0 Comments | Architecture & Design Java Open Source Software Development
I just ran across this article on TSS that refers to Spring as being the new Java EE. It provides some validation for the recommendations that we’ve been giving to clients for the past few years in regards to Spring being a preferred platform. The end of the article points out that Spring is being integrated with OSGi. This is actually a big deal. For those who don’t know what OSGi is, here’s a excerpt from the Spring page discussing it: "The Spring-OSGi project makes it easy to build Spring applications that run in an OSGi framework. A Spring application written in this way provides better separation of modules, the ability to dynamically add, remove, and update modules in a running system, the ability to deploy multiple versions of a module simultaneously (and have clients automatically bind to the appropriate one), and a dynamic service model."
Read More

.NET for Coffee Drinkers

.NET for Coffee Drinkers This post is intended to give the Java experts out there an overview of .NET technologies and how they compare to what we’re accustomed to in Java-land. Attitudes This is an interesting one. Microsofty blogs and whitepapers are inconsistent on their recommendations for architectures, as are the readers of these blogs. In one of the MVC blogs linked below, a couple of people replied criticizing Microsoft for providing tools that lead to overarchitecting! Frankly, I think this comes from a step that Microsoft is taking. Formerly, their tools were good for getting small, non-critical applications written quickly (typical RAD). Over the last couple of years, they’ve begun delivering tools and guidance that’s more appropriate to critical enterprise applications that will have to live and evolve over a period of years. This has led to people who need a Chevy, exposed to 18-wheelers for the first time, wondering why they need all that to get to the grocery store. Another interesting attitude in .NET-land is a confusion of ‘model’ with ‘picture’. Their current advice deprecates UML modeling in favor of creating UML pictures in Visio. Some of this, I believe, is lack of experience using true modeling tools in their thought-support role, particularly in large, mission-critical projects. While I’m not personally in favor of attempting to create models that replicate every detail of an implementation (A. that’s not a ‘model’. B. it won’t be maintained. C…), I do see a great deal of value in modeling tools to support visualization of what every competent developer already does, in an environment where those visualization can be shared and leveraged to help get the whole team on the same page. Web Application frameworks and techniques Generalities The biggest thing that I’ve had to get used to is that .NET assumes that the average developer is not capable of consistently writing thread-safe code. Because of this core assumption, any object intended to be used in a web application is instantiated for every request. ASP.NET basics This would be the canonical application framework for .NET web apps. The closest analogy in the Java world would be JSF. As in JSF, the developer can associate handler methods with various events on any widget on the web page. Unlike JSF, the view’s object graph is built more at compile time than at run time. This, combined with the fact that .NET developers are accustomed to having their world instantiated for every request, alleviates a lot of the performance concerns that have kept us away from JSF. Naturally, another advantage over JSF is that the tool support (really, the reason JSF was structured the way it was) actually exists. Monorail Yes, that’s an open source framework inspired by Ruby on Rails.http://www.castleproject.org/monorail/ ASP.NET new direction - MVC Microsoft developer/architect Scott Guthrie has posted a series of articles to his blog describing a new MVC framework that is now available as an add-on to Studio 2008. From what I can see, this is a fairly sensible framework and reminds me of a better-documented SwingMVC. part 1 part 2 part 3 part 4 Data access Traditional crap…, err CRUD The traditional method for Microsoft developers is the typical RAD technique of binding UI widgets to columns in tables. ASP.NET does provide the possibility of a bit of decoupling there - DataSet can be backended by XML as well as direct database access (in fact it’s organized via an xsd by default). However, this doesn’t really do a lot for real type-safety, and it’s pretty weak for separation of concerns. NHibernate Hibernate has been ported to .NET with substantially the same functionality. Problems with this in a .NET shop include the usual FUD concerns around generating SQL in general, as well as the usual concerns around open source, and also those produced by Microsoft’s recent/upcoming tools. ‘LINQ to SQL’ LINQ to SQL is a recently released technology from Microsoft that supports ROM (that’s Relational-Object mapping). There is, naturally, a graphical tool to support creating the .dbml file that is then used to generate the entity classes and a DataContext class (think Hibernate session, extended to provide typesafe query access for the specific entities in a domain). The graphical tool, however, is pretty useless except in the case where you’re wrapping existing tables (hence ‘ROM’). If you’re creating new stuff and you want to design your object model and generate the database from that, you’re better off typing the XML by hand. In my current toy project, I’m using the GUI tool to lay out the broad structures and a text editor to get the details right. As you might expect, I’m also not too fond of the tool’s need to generate the code. You can add manually coded methods to the generated classes, by virtue of the .NET partial class concept, but really, why can’t it just map existing classes to existing tables? If truly manually mapping, you can simply use attributes on your own classes, as in Hibernate with Annotations/JPA. Here’s another ScottGu blog (4 parts) A summary: this thing does most of what hibernate does, except not on POCOs, not as elegantly, and I can’t fix it when it breaks. ADO.NET Entity Framework Found here, another ROM framework! This one is more complex, and seems to want you to provide 3 xml files: ‘conceptual schema’, ’storage schema’, and a mapping specification. Why it needs the two schemas in XML, when they already (should be) in their respective domains (object and RDB) I’m not too certain. Once again, it generates the entity classes. Why did they make it this hard? I’ve not played with this at all at this point, so I don’t have any concrete comments.
Read More