Tuesday, May 3, 2016

JAVA 8 - what is Functional Interface and Lambda Expression, etc

Functional Interface is an interface with only one method.
- default methods do not count
- static methods do not count
- methods from the Object class do not count

A Lambda Expression is an instance of a functional interface.
public interface Predicate<T> {
    boolean test(T t);
}

Implementation would be:
Predicate<String> predicate = s -> s.length() < 20;
System.out.println(predicate.test("Hello world!"));//expicite way of using it

Friday, April 29, 2016

COLLECTIONS - mutable List vs unmodifiable view of List

When you use Collections.unmodifiableList(list) it will return unmodifiable view of that list, it means you will get an UnsupportedOperationException on add() over that view etc.

But in the same time the list itself remains to be mutable in case it is modified in proper way e.g. by the programm API.

JAVA - Map Big O notation chart, Algorithmic Performance


GRALDE - add custom external *.jar to module dependencies

1. An example is map-visualiser project from github
2. Clone that project and make gradlew build for it
3. It will build its *.jar inside of /build/libs
4. Create libs dir inside your module
5. Copy/past that *.jar into your module libs dir 
6. Add these LOCs below into module's build.gradle and build the project:

repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'    
    }
}

dependencies {    
    compile name: 'map-visualiser-1.0'
    testCompile group: 'junit', name: 'junit', version: '4.11'
}

Wednesday, April 27, 2016

SCALA - Scala for Java developers notes

Resources:
This course on Pluralsight
http://scalaforfunandprofit.com/why-use-fsharp/

http://docs.scala-lang.org/style/

History
Started in 2003 as research project in Switzerland.
Research was headed by Martin Odersky - an author of Java Generics and Java compiler.


Scala was adapted by:

Scala is for the future Software Development and there is non too much experienced devs
http://insights.dice.com/2014/04/04/employers-cant-find-enough-scala-talent/

Pure functions 
Is associated with objects and work without a side-effects (or mutation).
Define fixed variable - vow.

Higher order functions 
Functions are "first citizens" in Scala. This why functions could:

  • receive other functions in its parameters
  • return functions
  • to be stored for later execution

Tuesday, April 26, 2016

ANGULAR 2 - first look by John Papa

Property Binding



HTTP Services: Observable and Subscribe


Async Pipe: How Components code is simplified by it


Async Pipe can return Promise (so you can use ".then(f())") instead of Observable if you want

Routes: Defining route in decorator @RouteConfig

Routes: Declaring Routing Directives in @Component

Routes: Use Routing in HTML

The main A2 imports
import { Component } from 'angular2/core';
import { HTTP_PROVIDERS } from 'angular2/http';
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from 'angular2/router';
import 'rxjs/Rx'; // load the full rxjs

Use Routing for Menu with its Content



AGILE - comparison Agile with other mthodologies like Waterfall etc

SUMMARY


Waterfall




Waterfall V-Model


Agile comparison


Agile Manifesto

12 principles behind the Agile Manifesto can be split into 3 groups:
  • Regular delivery of software
  • Team communication
  • Excellence in design
Our highest priority is to satisfy the customer through early and continues delivery of valuable software.

Delivery working software frequently (couple weeks - couple months), a preference is shorter timescale.

Working software is the primary measure of progress. (In Scrum the feature is DONE means it is potentially shippable).

=====

Business people and developers must work together daily. They should be available for each other.

Face-to-Face communication is a better way to convey the information.

Self-organised team gives the most valuable product.

Build projects around motivated individuals.

RETROSPECTIVE: At regular intervals, the team reflects on how to become more effective

======

Continuous attention to technical excellence and good design enhances agility.

Simplicity is essential. Do just what you need now, not in sometime in the future.

Welcome changing requirements, event in late development.

===== METHODOLOGIES OF AGILE =======

Scrum is a lightweight management framework. 
Extreme programming is a disciplined approach at delivering high quality software quickly and continuously (delivery of 1-3 weeks).
Crystal methodology
Dynamic Systems Development Method.
Feature Driven Design. (FDD) (time-lapse 2 weeks)
Kanban.

Extreme Programming
Rules: planning, managing, design, coding, testing
====
4 Activities: coding, testing, listening (customers & users), designing
5 Values: communication (f-2-f), simplicity (solving today's problem today), feedback, courage (realise issues and fix it), respect
3 Principles: feedback, assuming simplicity, embracing change
12 Practices /4 groups: fine-scale feedback (pair programming), continuous process, shared understanding, programmer welfare
29 Rules /5 groups: planning, managing, designing, coding 

SCRUM

Split in 3 areas:
Roles: product owner (ussualy analist that communicate w/customer), scrum master (servant leader that fullfill the needs of the team), scrum team (5-9 people)
Ceremonies: sprint planning meeting, sprint review, sprint retrospective, daily scrum
Artifacts: product backlog, sprint backlog, burndown chart








======= DIFFERENCE between SCRUM and EXTREME PROGRAMMING ====

Scrum - has sprints from 2 weeks up to 1 month
XP - has iterations from 2 weeks

Scrum - teams do not allow changes into their sprints
XP - amenable to change within their iterations

Scrum - the team determine the sequence in which they will develop backlog items
XP - teams work in a strict priority order

Scrum - doesn't prescribe any engineering pactices
XP - prescribes many engineering practices like TDD, Pair Programming, Continuous Integration 


In practice: team take Scrum, but adds some engineering practices from XP like TDD, Continuous integration, Code Review (instead of Pair Programming)