Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 JAVA


  10 Object Oriented Design principles Java programmer should know

Object Oriented Design Principles are core of OOPS programming but I have seen most of Java programmer chasing design patterns like Singleton pattern , Decorator pattern or Observer pattern but not putting enough attention on Object oriented analysis and design or following these design principles. I have regularly seen Java programmers and developers of various experience level who either doesn't heard about these OOPS and SOLID design principle or simply doesn't know what benefits a particular design principle offers or how to use these design principle in coding.Bottom line is always strive...

5,446 0       JAVA PRINCIPLE OOP DESIGN


  Java vs F#

Dr Cliff Click of Azul Systems, specialists in manycore JVM systems, recently published a blog post about the performance of Java compared primarily to C and C++ but also discussing C# and .NET. Three of Cliff's comments are of particular interest:Under the heading "Places where C/C++ beats Java for obvious reasons":"Value Types, such as a 'Complex' type require a full object in Java." - Dr Cliff ClickWhat Cliff forgot to mention is that .NET also provides value types and a far more compelling example than complex numbers is the humble hash table.Consider the task of filling a hash table with ...

4,024 0       JAVA PERFORMANCE JVM F#


  Java Sequential IO Performance

Many applications record a series of events to file-based storage for later use.  This can be anything from logging and auditing, through to keeping a transaction redo log in an event sourced design or its close relative CQRS.  Java has a number of means by which a file can be sequentially written to, or read back again.  This article explores some of these mechanisms to understand their performance characteristics.  For the scope of this article I will be using pre-allocated files because I want to focus on performance.  Constantly extending a file imposes a significa...

3,071 0       JAVA IO SEQUENTIAL BLOCKING


  10 Points about Java heap memory

When I started java programming I didn't know what is java heap or what is heap space in Java, I was even not aware of where does object in Java gets created, it’s when I started doing professional programming I came across error java.lang.outofmemoryerror then I realized What is Heap in Java or Java Heap Space. Its happens with most of programmer because learning language is easy but learning basics is difficult since there is no formal process which can teach you every basics of programming its experience and work which reveals the secret of programming. For Java developer knowledge o...

5,549 0       JAVA TIPS HEAP MEMORY


  Tricks with Direct Memory Access in Java

Java was initially designed as a safe managed environment. Nevertheless, Java HotSpot VM contains a “backdoor” that provides a number of low-level operations to manipulate memory and threads directly. This backdoor – sun.misc.Unsafe â€“ is widely used by JDK itself in packages like java.nio or java.util.concurrent. It is hard to imagine a Java developer that uses this backdoor in any regular development because this API is extremely dangerous, not portable, and volatile. Nevertheless, Unsafe provides an easy way to look into HotSpot JV...

4,055 0       JAVA TRICKS JVM DIRECTLY MEMORY ACCESS


  Regex vs IndexOf in Java.

OverviewThe author of these articles Are C# .Net Regular Expressions Fast Enough for You? and .Net Regex: Can Regular Expression Parsing be Faster than XmlDocument or Linq to Xml? recently pointed out to me that he had found that Regular expressions were at least as fast or faster than the alternatives in C#. However it has been my experience that regular expressions in Java were slower. It is hard for me to say why this might be different in Java and C# or even if these are fair comparisons but here is what I found in Java.Searching XML for the start of a fieldThis test searches for the exp...

6,121 0       JAVA REGULAR EXPRESSION EFFICIENCY INDEXOF


  Finding selected checkbox items in a JSF dataTable

This is one of those problems that I couldn’t find a complete example for when I needed it, so hopefully this will save somebody else the extra time it took me to piece it together.We frequently need to have data tables in our UI, and allow the user to select a subset of those items for action. In JavaServer Faces, this means having a DataTable, each row having its own checkbox. But when the action is triggered, how to we find which items the user has selected.The first step is to add a boolean property to your objects that can represent the selection. If you have a lot objects in your ...

14,665 1       EXAMPLE JAVASERVER FACES JSF DATATABLE CHECKBOX


  Clojure & Java Interop

About a year ago I got a phone call asking if I wanted to join another team at DRW. The team supports a (primarily) Java application, but the performance requirements would also allow it to be written in a higher level language. I'd been writing Clojure (basically) full-time at that point - so my response was simple: I'd love to join, but I'm going to want to do future development using Clojure.A year later we still have plenty of Java, but the vast majority of the new code I add is Clojure. One of the big reasons I'm able to use Clojure so freely is the seamless interop with Java.Execute Cloj...

3,697 0       JAVA FUNCTION CALL CLOJURE INTEROPRABILITY COMMIT