Saturday, March 21, 2020

Aspects to log enter and exit method

https://github.com/vernetto/logaspect

The idea is:

use @EnableAspectJAutoProxy in a @Configuration

create an annotation EntryExitLogger to mark the method(s) you want to be logged for entry/exit

have a @Component annotated with @Aspect and inside it you specify the aspects:

@Around("@annotation(EntryExitLogger)")
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable{
}


That's all.

Detailed post on the topic https://medium.com/@wkrzywiec/moving-into-next-level-in-user-log-events-with-spring-aop-3b4435892f16

Doc of AspectJ here https://docs.spring.io/spring/docs/2.0.x/reference/aop.html

Good Aspectj cookbock here https://blog.espenberntsen.net/2010/03/20/aspectj-cheat-sheet/

Wednesday, February 19, 2020

github and line separators

https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_formatting_and_whitespace " You can tell Git to convert CRLF to LF on commit but not the other way around by setting core.autocrlf to input:

$ git config --global core.autocrlf input "



https://www.jetbrains.com/help/idea/configuring-line-endings-and-line-separators.html this one also helps



Per-repository settings

Optionally, you can configure a .gitattributes file to manage how Git reads line endings in a specific repository. When you commit this file to a repository, it overrides the core.autocrlf setting for all repository contributors. This ensures consistent behavior for all users, regardless of their Git settings and environment.


in Intellij there is an "Inconsistent line separators inspection", to check if the files have "line terminator" different from the default setup for the project
"This inspection detects files with line separators different from the project default. E.g. you set the line separator to "\n" in the Settings|Code Style|Line separator, and the file you are editing uses '\r\n' as a line separator"





Thursday, February 13, 2020

Spring Integration

https://youtu.be/oQ2CBtYrSYo?list=PLO0KWyajXMh6HbVTnf7YqwbEeZU6kuKJa nice tutorial here

code is available at https://github.com/vernetto/sidemo.git



Sunday, February 9, 2020

Activiti BPM

Activiti is related to Alfresco.


https://en.wikipedia.org/wiki/Activiti_(software) wikipedia

https://www.activiti.org/userguide/index.html here the userguide


https://youtu.be/UTl9LJ_Ob98 here excellent Activiti BPM presentation based on Eclipse


The Intellij Activiti BPM plugin doesn't seem to work any more (last update 2014)

Activiti gitub is here https://github.com/Activiti/Activiti




Friday, January 3, 2020

Lasse Koskela, Effective Unit Testing

https://www.manning.com/books/effective-unit-testing


I am really enjoying this book, the Author reflects about the STRATEGIC importance of well written Unit Tests as a way to DRIVE development.

It focuses also on the importance of writing SIMPLE CODE and avoid unnecessary complication:

"One of the worst offenders of code quality and a major contributor to
developers’ productivity crawling to a halt is accidental complexity.
Accidental complexity is unnecessary complexity. It’s complexity that could
be avoided by substituting a simpler design that still meets the requirements. Sometimes
we programmers like to demonstrate our mental capacity by producing such
complex designs that we have trouble understanding them ourselves. I will bet you
recognize that primal instinct in yourself, too. The problem with complex designs is
that complexity kills productivity and unnecessary complexity is, well, unnecessary
and counterproductive."