Posts Tagged ‘Java’
Some people will argue that it’s not worthy comparing Tomcat and JBoss, because one of them is a superset of the other. In fact JBoss is bundled with a forked version of Tomcat. So JBoss is Tomcat plus:
* JMS messaging provider
* Web Services engine (JAX-WS and/or JAX-RS)
* Management capabilities like JMX and a scripted administration interface
* A powerful data grid solution (Infinispan)
* Advanced security, e.g. out-of-the-box integration with 3rd party directories
* A dynamic and powerful clustering engine
* Transaction management service
Still many decision makers have to choose between these two, so lets’ take a deeper look at them.
The JBoss AS is an application server based on Java. It is an open source server and is usable in any operating system supported by Java.
Apache Tomcat, or its more widely known name Tomcat, is a servlet container (meaning it is a Java class that operates under the strictures of the Java Servlet API – a protocol by which a Java class responds to an http request). This is an open source server, providing a ‘pure Java’ HTTP web server environment in which code written in Java is capable of running.
Tomcat is only a servlet engine and JBoss offers many more functionalities out of the box. Still JBoss is no longer a heavyweight monolithic container, but a modular application server featuring true classloading isolation, modules loaded on demand, domain management and exceptionally lightweight container. It has a pluggable architecture and if required, you can unplug features from JBoss to make it essentially a Tomcat servlet container.
At the same time the plus going in favour of Tomcat is that it is fairly lightweight, and it means less memory requirement and a faster response. At the same time if you need certain JEE features beyond the Servlet API, you can easily enhance Tomcat. For example, if you need JPA features you can include Hibernate or OpenEJB and JPA works nearly out of the box.
Tomcat is hassle free and might be the right choice when you are not using much of Java features. It is a very good fit if it comes to web centric, user facing applications.
In case backend integration comes into play, a JEE application server should be considered. Last but not least, migrating a WAR developed for Tomcat to JBoss should be a 1 day exercise.
Some people still argue that instead of using application servers, one can still deliver a full stack application using Tomcat + Spring adding the right frameworks and writing the Spring integration layer with these frameworks. That’s for sure true. Still the logical question is what price you will have to pay for that. The JBoss project can be focused around average – to junior developers. Mastering the same complex stack of technologies with Tomcat and Spring requires skilled and well paid developers.
To make it short, Tomcat is merely an HTTP server and Java servlet container. JBoss is a full-blown JEE application servers, including an EJB container and all the other features of that stack. On the other hand, Tomcat has a lighter memory footprint (~60-70 MB), while JBoss weigh in at hundreds of megs. Tomcat is very popular for simple web applications, or applications using frameworks such as Spring that do not require a full JEE server. Administration of a Tomcat server is arguably easier, as there are fewer moving parts.
However, for applications that do require a full JEE stack (or at least more pieces that could easily be bolted-on to Tomcat) JBoss is one of the most popular open source offerings. JBoss has a larger and deeper user community, and a more mature codebase.
So, we should not really care anymore about which is better, but focus on the application requirements. However, you can still use the best of these two worlds in your enterprise applications.
It would be great if your could share your opinions on this topic Thanks in advance for your comments!
Aliona Kavalevich – Business Development Manager (LI page)
Altabel Group – Professional Software Development
Scala is a statically typed and multi-paradigm programming language that runs on Java virtual machine and provides Java like syntax with a few improvements.
Being a multi-paradigm programming language, Scala allows for mixing multiple programming styles such as object oriented, imperative and functional programming. Whether it’s good or not, it is not a question that could be answered with a yes or no. Supporters would say that programmers can choose from a variety of styles and stick to the best depending on their needs. The others would argue that putting together some features found in many other programming languages can’t work well, mostly by increasing complexity and making a programming language obscure.
Scala code compiles to a byte code and runs on Java virtual machine, thus it is compatible with other Java applications. If most of your code and libraries are from Java world, this can be nothing but a good thing. At the same time some additional complexity in Scala is dictated by assuring compatibility with Java.
For some developers the Scala code is obscure, for others could be a nice and neat form of solving some specific problems.
One more positive aspect of Scala is its conciseness. We all know how Java verbose is and how many boiler code developers write everyday including constructors, getters, variable initialisation (type and generics), semicolons and many others.
Now let’s see some other aspects of working with Scala:
At first sight the performance in Scala is very good, comparable to Java. Scala code compiles to the same byte code as Java does and runs on the same Java virtual machine. Still how fast Scala code is may vary from case to case and usually it’s up to the way how the code is written. The awareness of how to write a high performance Scala code is especially important for Java developers who are not very experienced in both Scala and functional programming.
There are not too many development tools created specifically to serve Scala, but fortunately, thanks to compatibility with Java it doesn’t look so bad. One family of tools hardly usable in Scala are those, which do some sort of code analysis, for instance code coverage and static code analysis. Static code analysis tools are even less usable.
The two worth to mention native Scala extensions are Lift web framework and Akka actors platform.
The majority of libraries and frameworks from a Java world, should be possible to use quite smoothly, which among other things, is thanks to implicit conversions in Scala.
Interoperability between Scala and other programming languages, including Java/C/C++, is very good, mostly because of running on Java virtual machine. What Java may talk to, Scala can do as well. Taking into account support for implicit conversions described above, I would state that Scala is one of the leaders of interoperability among all programming languages.
Developers are provided with all they need to test Scala applications efficiently. To follow a Test Driven Development methodology, they can use popular in Java world Junit tool. If someone is more keen on Behaviour Driven Development then ScalaTest is a way to go.
Monitoring and maintenance
One of the main monitoring tools to analyze production Scala applications is JMX (Java Management Extensions). This tool does its job well when we want to analyse some predefined statistics, but sometimes we need to investigate some aspects of a production application while it’s running and JMX can’t provide all required data. To deal with such scenarios, Java provides Java Virtual Machine Tool Interface (JVM TI) that allows for inspecting running Java applications but it can be used for Scala too.
Scala community, including forum, mailing list and blogs, is not the biggest in the world, but it’s very energetic. Most people who are part of a Scala community are very passionate developers, which are always happy to help others to solve their problems. Books are also great: Programming in Scala book by Marting Oderski, Lex Spoon and Bill Venners.
No one will argue that it is far behind other programming languages such as Java or C/C++. Still while looking for Scala developers we could search for Java developers with Scala interests as well. The learning curve is not massive as Scala follows Java syntax. In such case, at least on experienced Scala developer would help the team adopting new programming language.
Have you moved from Java to Scala? How do you find this language?
Thanks for sharing your opinion!
Aliona Kavalevich – Business Development Manager (LI page)
Altabel Group – Professional Software Development
Few people engaged in software development sphere would deny the popularity of Spring. As many would agree, it is not just what is called “one more framework” and it still preserves its popularity till now.
In this article let’s try to discuss why it is so popular and why use it. So let’s focus on the major advantages of this open source application framework for the Java platform.
Following are some of the major benefits offered by the Spring Framework:
* Spring Enables POJO Programming. Spring enables programmers to develop enterprise-class applications using POJOs. With Spring, you are able to choose your own services and persistence framework. You program in POJOs and add enterprise services to them with configuration files. You build your program out of POJOs and configure it, and the rest is hidden from you.
* Spring Provides Better Leverage. With Spring, more work can be done with each line of code. You code in a more fast way, and maintain less. There’s no transaction processing. Spring allows you to build configuration code to handle that. You don’t have to close the session to manage resources. You don’t have to do configuration on your own. Besides you are free to manage the exceptions at the most appropriate place not facing the necessity of managing them at this level as the exceptions are unchecked.
* Dependency Injection Helps Testability. Spring greatly improves your testability through a design pattern called Dependency Injection (DI). DI lets you code a production dependency and a test dependency. Testing of a Spring based application is easy because all the related environment and dependent code is moved into the framework.
* Inversion of Control Simplifies JDBC. JDBC applications are quite verbose and time-taking. What may help is a good abstraction layer. With Spring you can customize a default JDBC method with a query and an anonymous inner class to lessen much of the hard work.
* Spring’s coherence. Spring is a combination of ideas into a coherent whole, along with an overall architectural vision to facilitate effective use, so it is much better to use Spring than create your own equivalent solution.
* Basis on existing technologies. The spring framework is based on existing technologies like logging framework, ORM framework, JEE, JDK timers, Quartz and other view related technologies.
So you can’t but deny the fact that using of Spring framework gives you a number of advantages. Some consider it a kind of standard for enterprise Java development. The others would argue. You are certainly free to agree or disagree or choose it or not or which parts of it you want to use and which are useless. But the fact is that it may be rather effective and give you some benefits.
And what is your opinion of Spring framework? What do you see as its advantages? Please help me to make a list of them longer!:)
Thanks for your attention! Wait for your comments!
This time as a part of cross platform development I’d like to make a short review of Mono project’s implementations/frameworks – MonoTouch and Monodroidthat allow creating applications using .NET framework and languages.
MonoTouch is a framework that allows developers create iPhone applications using the compilation of C# and reusing the existing .NET source code, libraries and skills.
The MonoTouch includes:
• Mono for the iPhone, iPad and iPod Touch
• C# and .NET compilers – on the iPhone you will need to compile the existing C# code and tools with the help of MonoTouch compiler to make sure that all the assemblies are referenced.
• .NET Bindings to Native APIs – MonoTouch compiler turns to compile the .NET libraries and base assemblies to create native iPhone applications.
• Mac oriPhoneSDK -includes the Xcode IDE, iPhone Simulator, and a suite of additional tools for developing applications for iPhone, iPad and iPod Touch.
• MonoDevelop Integrationhelps developers to integrate all features/toolsets from the integrating.NET platform to the target iPhoneenvironment from zero in no time
• Libraries that bind the native CocoaTouch APIs – toolsets that help to create native application interfaces for iPhone, iPad and iPod Touch
Mono for Android (MonoDroid)is a software development environment kit that allows to create the applications that run on Android phones and tablets.
Mono for Android consists of the core Mono runtime, the Mono for Android bindings to the native Android APIs, a Visual Studio 2010 plug-in to develop Android applications and an SDK that contains the tools to build, debug and deploy your applications. The Visual Studio 2010 plug-in allows developers to use Visual Studio 2010 to develop, debug and deploy their applications to an Android simulator, an Android device, or the Android Application Store.
Being the customer of Mono product you get one-year subscription to its product updates. The updates engaged the bug fixes and API changes. You could check the latest updates for Mono on the website called Xamarian Developer Center following this linkhttp://docs.xamarin.com/.
One of the latest upgrades released in May of 2012 by Xamarian Mono for Android is considered the research project called XobotOS.
XobotOS – the attempt to put C# code in the place of removed Java code in Android operating system. The idea is to write native code using C# instead of Java seems to extend the opportunities of Mono project. As the developers say the transition from Dalvik to Mono virtual machine performed good results like high-performance and low-battery consuming. Sharpen was chosen as the tool convertor for porting million lines of Java code to C#. It was upgraded for XobotOs and presented as its part release. The next goal of the company isto provide the direct access to the graphics library Skia for building applications.
What is the pricing?
Monotouch/MonoDroidare available in Professional Edition and Enterprise Editions: Monotouch/MonoDroid costs $399 for the entry level Professional edition and $999 and $2,499 for the Enterprise and Enterprise Priority version. A trial version is available which isn’t time limited but only allows deployment to an iPhone simulator.
The development of applications using cross platforms development approach seems to give the right idea for the developers how to manage with different environments and languages. Having reviewed the Mono project frameworks the advantages both of them may be summed up as follows:
- Applications written in C# for Android (MonoDroid) could be easily ported to iOS (MonoTouch);
-The source code written on C#, could be reused in MonoDroid and MonoTouch;
- The full support of C#: Language Integrated Query (LINQ), delegates, lambdas, events, garbage collection and many other features
- The support of Visual Studio and XCodefor bothMonoDroid and MonoTouch
- New challenges and updates guides
If you know something about programming with MonoTouch/ModoDroid and you have anything to add to my review, please, feel free to share your thoughts and experience on this point.