Web Apps With Angular presented by Raju Gandhi
Angular is implemented as a hierarchy of components. This diagram exhibits an Angular component hierarchy.
Components are declared in a module and assigned an HTML tag. To use the component, place the tag inside a HTML document. You may use the CLI build tool to generate the scaffolding for a component. Raju said the Chrome browser plugin Augury has the best support for debugging Angular. Angular has import statements, classes, modules, support for the new Observable API, sophisticated routing and so much more. I see why it’s so popular these days.
Refactoring to Java 8 presented by Kenneth Kousen
This session consisted of a few tips to take advantage of some of the new constructs in Java 8. Kenneth identified four principles to keep in mind when refactoring to Java 8:
- From imperative to declarative
- Don't iterate -- transform
- Favor immutability
- Functional style
There are four main programming paradigms: imperative, declarative, functional (which is considered a subset of the declarative paradigm) and object-oriented. Declarative programming: is a programming paradigm that expresses the logic of a computation ("what to do") without describing its control flow ("how to do it"). Java is inherently imperative. With Java 8, you may use Lambdas to implement declarative programming.
Use streams to transform data versus iterating over data. With streams, it’s much easier to parallelize computations. But, Kenneth said, even though it may be easier, a performance increase depends on the volume of data; if the data can be partitioned; and how much time you have to spend on each partition. He suggested using the JMH benchmark tool to benchmark performance.
Kenneth said Java now supports underscores in numeric literals to improve readability. For example, you may say:
long socialSecurityNum = 999_99_9999L;
The rules are you may place underscores only between digits; you cannot place underscores in the following places:
- At the beginning or end of a number
- Adjacent to a decimal point in a floating point literal
- Prior to an F or L suffix
- In positions where a string of digits is expected
Reactive Programming in Java presented by Venkat Subramaniam
Use RxJava to implement reactive programming in Java. This is a diagram of the features of Reactive Programming
Reactive Programming is push versus pull technology. Here’s a diagram showing the difference between interactive and reactive programming:
This session was very technical with lots of coding examples so for details on RxJava see Venkat’s You Tube video
- Does static code analysis
- May catch common mistakes and defects automatically.
- Highly configurable. Dozens and dozens of options. Configuration is in JSON and may be done in inline, via file or in package.json
- Tune via ‘enforcing’ and ‘relaxing’ options. Enforcing makes JSHint more strict. Relaxing does the opposite.
- Few programs pass on first run. Tune options to rules that best fit your team.
- Source code visualizer, complexity analyzer
- Leverages JSHint
- Cyclomatic complexity, line count, param count. Cyclomatic complexity is a software metric (measurement), used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code.
- Halstead metrics, maintainability index.
- You may point Plato to a JSHint option file or you may turn off JSHint
Here’s an example of a Plato report:
- Doesn’t require the DOM or other libraries.
- Includes beforeEach and afterEach for setup/teardown.
- Includes a waitFor to test asynchronous cases.
- Works with several testing frameworks
- Works with continuous integration servers like Jenkins
- Change a file, Karma runs the tests
- Karma spawns a web server
- Ships with Chrome and PhantomJS.
- Plugins for all major browsers.
- Use to identify what has been tested and what has not.
- Computes statement, line, function and branch coverage
- Can run at the command line or as part of build
- HTML and LCOV reports.
Here’s a sample Istanbul report:
Java 9 - The Jigsaw Module System presented by Kirk Knoernschild
Kirk said the primary new feature in Java 9 is the introduction of modules. With standard Java, any public class in any JAR on the classpath may be seen by any other classes on the classpath! With a module system, you have control over who sees what!
These are some features of a module:
- Published Interface - Make a module’s published interface well known.
- External Configuration – Modules should be externally configurable.
- Default Implementation - Provide modules with a default implementation.
- Module Facade – Create a facade serving as a coarse-grained entry point to another fine-grained module’s underlying implementation.
Each module has a module-info.java file. In that file, you identify any external modules the module requires and the full path of classes the module exposes. Other modules may only interface with the exported classes. Here’s a diagram showing the relationship between two modules:
Since all classes on the classpath will no longer be globally available, dependency injection and Java’s Class.forName(...) may no longer work.
You may use the Java Dependency Analysis tool JDEPS, to help identify all of your program’s interdependecies so you may start preparing for Java 9 modules.
JShell: The REPL for Java presented by Venkat Subramaniam
Groovy, Scala, Haskell and other languages already have a REPL (Read Eval Print Loop). Now in Java 9, Java will have a REPL. A REPL may be good to do prototyping, experimenting with new constructs in the language, or as a learning/teaching tool. To access help in JShell, use /help. The “/” prefix indicates to JShell you’re executing a JShell command versus a command to the JVM. Use control D or /exit to quit JShell. Here’s a short video showing a demo of JShell.
The 2017 Northern Virginia Software Symposium is a good way to get exposure to language updates and new technologies. It's local, informative, industry leading speakers, and only around $1000 so you get a lot of information with only a small impact to your training budget. There's another one coming in October so if you still have money available in your training budget, be sure to check it out.