This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!

Peter Rooke

Bartender
+ Follow
since Oct 21, 2004
Peter likes ...
IntelliJ IDE Java Linux Mac OS X Oracle Redhat Spring Tomcat Server VI Editor
Newcastle Upon Tyne, England, United Kingdom
Cows and Likes
Cows
Total received
18
In last 30 days
0
Total given
0
Likes
Total received
38
Received in last 30 days
2
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Peter Rooke

Just reading this and recalling some previous projects!  
EJB entity beans using CMP meshed in with all those J2EE design patterns    
I do think Sun made a mistake of continuing to use the Enterprise Java Beans name with the improved version 3.  

Here's a few humorous posts highlighting some of the "features" of these older technologies;

2004 A Workspace Odyssey (EJB2 CMP)
Totally Gridbag (GUI Swing)
S Stands For Simple (SOAP)
1 month ago
Just put together the exam topics in text format (taken from the oracle website);

Java SE 11 Programmer I | 1Z0-815

Understanding Java Technology  and environment
--> Describe Java Technology and the Java development environment
--> Identify key features of the Java language

Working With Java Primitive Data Types and String APIs
--> Declare and initialize variables (including casting and promoting primitive data types)
--> Identify the scope of variables
--> Use local variable type inference
--> Create and manipulate Strings
--> Manipulate data using the StringBuilder class and its methods

Working with Java Arrays
--> Declare, instantiate, initialize and use a one-dimensional array
--> Declare, instantiate, initialize and use two-dimensional array

Creating and Using Methods
--> Create methods and constructors with arguments and return values
--> Create and invoke overloaded methods
--> Apply the static keyword to methods and fields

Reusing Implementations Through Inheritance
--> Create and use subclasses and superclasses
--> Create and extend abstract classes
--> Enable polymorphism by overriding methods
--> Utilize polymorphism to cast and call methods, differentiating object type versus reference type
--> Distinguish overloading, overriding, and hiding

Handling Exceptions
--> Describe the advantages of Exception handling and differentiate among checked exceptions, unchecked exceptions, and Errors
--> Create a try-catch block and determine how exceptions alter normal program flow
--> Create and invoke a method that throws an exception

Creating a Simple Java Program
--> Create an executable Java program with a main class
--> Compile and run a Java program from the command line
--> Create and import packages

Using Operators and Decision Constructs
--> Use Java operators including the use of parenthesis to override operator precedence
--> Use Java control statements including if, if/else, if/elseif, switch , break and continue statements
--> Create and use do/while loops, while loop, and for looping statements including nested loops
--> Describing Objects and Classes

Declare and instantiate Java objects, and explain objects' lifecycles (including creation, dereferencing by reassignment, and garbage collection)
--> Define the structure of a Java class
--> Read or write to object fields

Applying Encapsulation
--> Apply access modifiers
--> Apply encapsulation principles to a class

Programming Abstractly Through Interfaces
--> Create and implement interfaces
--> Distinguish class inheritance from interface inheritance including abstract classes
--> Declare and use List and ArrayList instances
--> Understanding Lambda Expressions

Understanding Modules
--> Describe the Modular JDK
--> Declare modules and enable access between modules
--> Describe how a modular project is compiled and run


Java SE 11 Programmer II | 1Z0-816

Java Fundamentals
--> Create and use final classes
--> Create and use inner, nested and anonymous classes
--> Create and use enumerations

Java Interfaces
--> Create and use interfaces with default methods
--> Create and use interfaces with private methods

Functional Interface and Lambda Expressions
--> Define and write functional interfaces
--> Create and use lambda expressions including statement lambdas,local-variable for lambda parameters

Built-in Functional Interfaces
--> Use interfaces from java.util.function package
--> Use core functional interfaces including Predicate, Consumer, Function and Supplier
--> Use primitive and binary variations of base interfaces of java.util,function package

Migration to a Modular Application
--> Migrate the application developed using a Java version prior to SE 9 to SE 11 including top-down and bottom-up migration,
splitting a Java SE 8 application into modules for migration
--> Run a modulaized application on classpath and on modulepath
--> Use jdeps to determine dependencies and identify way to address the cyclic dependencies

Concurrency
--> Create worker threads using Runnable, Callable and use an ExecutorService to concurrently execute tasks
--> Use java util concurrent collections and classes including CyclicBarrier and CopyOnWriteArrayList
--> Write thread-safe code
--> Identify threading problems such as deadlocks and livelocks

I/O (Fundamentals and NIO2)
--> Read data from and write console and file data using I/O streams
--> Use I/O Streams to read and write files
--> Read and write objects by using serialization
--> Use Path interface to operate on file and directory paths
--> Use Files class to check, delete, copy or move a file or directory
--> Use Stream API with Files

Database Applications with JDBC
--> Connect to databases using JDBC URLs and DriverManager
--> Use PreparedStatement to perform CRUD operations
--> Use PreparedStatement and CallableStatement APIs to perform database operations

Annotations
--> Describe the purpose of annotations and typical usage patterns
--> Apply annotations to classes and methods
--> Describe commonly used annotations in the JDK
--> Declare custom annotations

Exception Handling and Assertions
--> Use try-with-resources construct
--> Create and use custom exception classes
--> Test invariants by using assertions

Generics and Collections
--> Use wrapper classes, auto-boxing and auto-unboxing
--> Create and use generic classes, methods with diamond notation and wildcards
--> Describe Collections Framework and use key collection interfaces
--> Use Comparator and Comparable interfaces
--> Create and use convenience methods for collections

Java Stream API
--> Describe the Stream interface and pipelines
--> Use Lambda expressions and method references

Lambda Operations on Streams
--> Extract stream data using map, peek and flatMap methods
--> Search stream data using search findFirst, findAny, anyMatch, allMatch and noneMatch methods
--> Use Optional class
--> Perform calculations using count, max, min, average and sum stream operations
--> Sort a collection using lambda expressions
--> Use Collectors with streams, including the groupingBy and partitioningBy operation

Services in a Modular Application
--> Describe the components of Services including directives
--> Design a service type, load services using ServiceLoader, check for dependencies of the services including consumer and provider modules
--> Compare abstract classes with interfaces

Parallel Streams
--> Develop the code that use parallel streams
--> Implement decomposition and reduction with streams

Secure Coding in Java SE Application
--> Prevent Denial of Service in Java applications
--> Secure confidential information in Java application
--> Implement Data integrity guidelines- injections and inclusion and input validation
--> Prevent external attack of the code by limiting Accessibility and Extensibility, properly handling input validation, and mutablity
--> Secure constructing sensitive objects
--> Secure Serialization and Deserialization

Localization
--> Use Locale class
--> Use resource bundles
--> Format messages, dates, and numbers with Java
Don't worry - the thing is we are all constantly learning, that seems to be the deal as technologies are always evolving.

As for Spring - don't worry about XML configuration as that way of configuration is now old and the preferred method of configuration is either Java Configuration or / and component scanning.  

For learning I'll start with the core spring documentation, which was always quite good Spring Core

I do think that using spring adds some extra complexity to any project, but the real win is in later stages when code is more maintainable.  Some of us remember before spring and when we had J2EE enterprise java beans [2] which were just horrific ;-)  
1 month ago
Hi all, just an recommendation for a podcast that I've listened to for a few years.

Software Defined Talk

- normal topics include; kubernetes, serverless, cloud, devops, coding, software development, languages, agile, business strategy, and of course general stuff (weather/food/drink/travel), mixed up with some comedy.  

Enjoy.    
1 month ago
Just to add; (IMHO) from a high level the overall objective of Spring is to improve system design for better quality and maintainability.  
The aim is to allow as much as possible, a flexible, customisable framework in which developers can focus on the business domain logic (in plain old java classes [pojo]) rather than having to deal with all the software infrastructure complexities.  The framework uses DI (or IoC) to reduce coupling (reduce the fixed ties between parts of the system), and also increase cohesion (classes / methods do one thing).  DI has been discussed above.  


1 month ago
Docker containers would also be another option Setting up Kali Linux in Docker on Windows 10 [Micro$wipe]

Kali is a bit of a specialist linux distribution, really aimed at penetration testers.  
2 months ago
Hi, of your using bash then the following two commands placed at the top of the script will help



Then when you run the script it will;
  - set -v Display the shell input lines as they are read
  - set -x Display the commands and their arguments as they are executed

As for logging, I've just recently inherited a load of shell scripts (at work) which I did not like much.  So I've added logging and have been trying to add testing code using the bats (bash automated testing system).  The testing code is quite tricky and is work in progress ;-)

However since I've opted to write my own simple logging function, I've taken out the product specific parts and it can be seen below.  Works on Red Hat Linux, I tried on my Mac and seen a lot of date function errors.

Here's the code;

loggingUtility.sh


And here is an example of how to use;



I may put this into a git hub repository, time permitting.  
2 months ago
This may help Pivotal Certification

It appears that the older Enterprise / Web Developer certifications are not longer offered, being replaced with more Cloud Foundry focused certifications.

There are (were) a few books, but I'm not sure how relevant these are now; Core Spring Certification Book

Pivotal encourage potential students to attend their courses, but they are not cheap.  
Well there is this post from a fellow rancher --> Spring Cerification Passed

I did the previous certification and found it tricky, both in terms of the amount of subjects that were covered and the depth of knowledge that was required.  From what little I have seen of the new exam, it seems the older less used technologies have been (thankfully) replaced.  This should help as I didn't like having to revisit all of those horrid technologies of the past (RMI, SOAP - see S Stands for Simple ) as I doubt (hope) that I'll never see them even if Spring has made their use less painful.  Far better to be learning about Spring Boot.

There is also a book, Spring Certification Book - I've not read it - but have a copy of the enterprise book which is good.    
2 months ago
During a (spring) web presentation I heard about a [yet another] new spring project Spring Data R2DBC - seems to be what you were asking for.

I don't know anything much about this new project, and this new "reactive" [buzz] word was new to me but from the docs;

Part of the answer why R2DBC was created is the need for a non-blocking application stack to handle concurrency with a small number of threads and scale with fewer hardware resources. This need cannot be satisfied with reusing standardized relational database access APIs - namely JDBC – as JDBC is a fully blocking API. Attempts to compensate for blocking behavior with a ThreadPool are limited useful.


R2DBC Spring Docs
2 months ago
This was on the "local" news, SolarCan, not for the Moon.  It's a pin hole camera in a can for long exposure pictures of the Sun.  Novel idea.  
2 months ago
Oh ok, last night was Burn's night - celebrating the poet Robert Burns with whiskey (yum) and Haggis (yuk).  
2 months ago
Nice one and well done ;-)  Thanks for the GitHub repository, had a quick browse and it does look good.  
Just to add that nothing runs faster than a well written stored procedure that will run within the database.  Not sure how this would work with your existing code.

I've also worked on systems in which the information is marked as "deleted", typically a boolean flag column in the table.  This then excludes the information from any future queries.  At a later date all rows that have been marked for deletion are then deleted and/or moved into an archive.  Of course all database queries need to consider this flag.
3 months ago