Wednesday, 31 August 2016

Functional Features in Java 8

Short History of Java


Java originated in 1995 and it was the language of the Internet and provided some unheard of capabilities in mainstream static typed languages, such as garbage collection, cross-platform out of the box (Write Once Run Anywhere), automatic documentation and the ability to run inside the browser as Java Applet. It quickly became very popular, especially for enterprise systems. About six years later, C# was released. The C# designers had taken a good look at Java and produced a language that was very similar, but addressed many of the issues that came to the front during Java's first years. Ever since, Java has been playing catch-up with C# and other languages in terms of language features.

Monday, 29 August 2016

Programming Basics: The Function Signature

The basic unit of programming is the function. You build your program one function (or method) at a time. The smallest thing you can test in a unit test is a function. A function is also the smallest piece of code you can name and hence create a new abstraction. The whole point of a function is to encapsulate some piece of code and make it available to the rest of your program or other programs in a library.

Tuesday, 23 August 2016

Discovering a Java Application's Security Requirements

Application security is not easy - we know that. But we also know there are steps we can take to mitigate the risk of security failures. If we are network engineers, we invest in knowledge of network partitioning and packet filters. If we program in C, we protect against buffer overflow. If we program in Java, we consider running our application under the protection of a security manager. In each case, we use knowledge of best practices to give ourselves an advantage over inadvertent system failure.

The security provisions for Java applications are well-documented, and form a superset of the discussion in this article. Our discussion focuses on aspects of Java security managers, a topic which is a small subset of the Java security architecture.

Monday, 22 August 2016

Designing Messaging Applications with Temporary Queues

Introduction


Most JMS destinations (queues and topics) are created administratively and are treated as static resources, even though dynamic destinations (temporary queues and temporary topics) are supported in JMS. Using static queues to communicate between tiers of a client/server application creates barriers to scalability and maintainability. In this article, we will look at the benefits and drawbacks of using temporary destinations in an enterprise healthcare system. We will also look at design perspectives for using temporary queues as an alternative to static queues and explore some design strategies using synchronous requests and replies.

Sunday, 21 August 2016

IRC Text to Speech with Java

Internet Relay Chat (IRC) is a network chat system used by millions of people all over the world. It has been around for several years and is used by groups of friends, programmers, universities, and even banks to facilitate discussions, the exchanging of ideas, and collaborative research.

Because IRC is very much a real-time chat system, you will rarely benefit from using it unless you are able to pay close attention to the sequence of dialog as it transpires. Unfortunately, this can lead to a lack of productivity in the workplace, which is why many employers naively frown upon the use of IRC. However, when used properly, IRC can let employees work effectively with remote colleagues, regardless of whether they are on the other side of the planet or just in the next building. Real-time group chat systems like IRC make it easier to organize meetings (and possibly even carry out virtual meetings), ask questions, and to negotiate the less-important things such as where to go for lunch.

Friday, 19 August 2016

Schemaless Java-XML Data Binding with VTD-XML

This article introduces a new Java-XML data binding technique based entirely on VTD-XML and XPath. The new approach differs from traditional Java-XML data binding tools in that it doesn't mandate schema, takes advantage of XML's inherent loose encoding, and avoids needless object creation, resulting in much greater efficiency.


Limitations of Schema-based XML Data Binding


XML data binding APIs are a class of XML processing tools that automatically map XML data into custom, strongly typed objects or data structures, relieving XML developers of the drudgery of DOM or parsing.SAX 

Thursday, 18 August 2016

Real-Time Java: An Introduction Part - 1

I've worked in investment banking for several years and my experience suggests that most problems in financial software arise from the lack of real-time support. Many large financial IT systems use a Java platform, and even an unplanned two-second stop for full garbage collection in an application can cause a loss of tens of thousands of dollars. The situation is worsened by the fact that garbage collections usually occur during a high-application activity, when the app is especially sensitive to any breaks in execution. The same situation occurs in other high-tech and production industries, which is why they are taking a careful look at real-time Java specification and its implementations.

Wednesday, 17 August 2016

Introduction to Amazon S3 with Java and REST

Introduction


Amazon Simple Store Service (S3) is a service from Amazon that allows you to store files into reliable remote storage for a very competitive price; it is becoming very popular. S3 is used by companies to store photos and videos of their customers, back up their own data, and more. S3 provides both SOAP and REST APIs; this article focuses on using the S3 REST API with the Java programming language.

Saturday, 13 August 2016

Guide to time and date in Java

Properly handling dates, time, time zones, daylight saving time, leap years and such has been my pet peeve for a long time. This article is not a comprehensive guide to time domain.It’s still relevant, but doesn’t cover java.time from Java 8. I want to cover the absolute minimum that every junior Java developer should be aware of.

When did an event happen?


Philosophy and quantum physics aside, we may treat time as a one-dimensional metric, a real number value. This value keeps growing when time passes by. If one event appeared after another, we assign greater time to that event. Two events happening simultaneously have the same time value.

Saturday, 6 August 2016

What is Java Content Repository

JSR-170 defines itself as "a standard, implementation independent way to access content bi-directionally on a granular level within a content repository," and goes on to define a content repository as "a high-level information management system that is a superset of traditional data repositories, [which] implements 'content services' such as: author based versioning, full textual searching, fine grained access control, content categorization and content event monitoring."

The Java Content Repository API (JSR-170) is an attempt to standardize an API that can be used for accessing a content repository. If you're not familiar with content management systems (CMS) such as Documentum, Vignette, or FileNet, then you must be wondering what a content repository is.

Thursday, 4 August 2016

Java and Web Services Primer

Web Services are a new technology that could revolutionize the way business-to-business and business-to-consumer services are provided. Web Services use a variety of technologies to allow two applications to communicate. However, none of these are new claims; what makes Web Services different from other similar mechanisms are the technologies which provide the service.

Web Services have at their core XML as a mechanism for communication. Ultimately, Web Services are based on three specific technologies: a mechanism to register a service, a mechanism to find a service, and a mechanism for two parties to communicate. Today, developers can use the Java 2 Enterprise Edition APIs and XML to provide Web Services. Such developments leverage existing Web sites and provide simple methods to extend, interconnect and publish existing J2EE-based applications in new and exciting ways.

Wednesday, 3 August 2016

SQL Database Access with DBTags

In a J2SE or J2EE application, Java Database Connectivity (JDBC) can be used to create a connection with a SQL database, create database tables, retrieve result sets, and update the database. To use a database from a Java Server Page (JSP), one often uses a JSP scriptlet to create a JDBC connection via the getConnection() method.

Jakarta DBTags is a custom tag library that contains tags to perform the same tasks -- creating a database connection, creating tables, retrieving result sets, and updating tables with prepared statements -- all without the use of JSP scriptlets.