IndividualApprenticeship Patterns – Draw Your Own Map

Draw you own map was the topic i picked for this week. I really enjoyed reading this pattern. It gives me the understanding of how to beat or overcome the huddles of learning new stuff and become very good at what we do or love.

From the reading, i also got to know, in order to be happy at your work place or your next career. You will have to pick a field you enjoy which most of my time i will be spending. The stories that Desi and Chris’s gave, give me the knowledge that planing your career at an early stage helps a lot. It makes you know what to expect and also what you want. Also from their stories, they could have prevented ending up in a a job they dislike by getting more info or doing more research about their next career or job. In case you did your research and landed to the job and later found out that it is not good for you. It is not late to change or learn new stuff. The pattern also gives ways on how to draw you own map. To me, it was very easy to understand and also felt it is the best way. The actions taken when drawing the map will definitely land you to the dream job you are looking for.

I really like this pattern(draw your own map. It has showed me a lot on how to really design my map in terms of my next career or job. it has also open my mind not just on my field of studies after graduating but also in life in general. I realized this technique that book showed, applies to everything. Not only for programmers or computer science students. I even made my own map which was really fun. I add four desirable jobs i will want to have for the next six years to come. On map diagram, about the desirable jobs, i included jobs no related to my field. Added fields like being a chef and nurse. Also added things i should be learning, whether things not related to my field or new programming languages.

Advertisements

Lambda expression in java

A Lambda Expression is a representation of an anonymous function which can be passed around as a parameter thus achieving behavior parameterization. A lambda consists of a list of parameters, a body, a return type and a list of exceptions which can be thrown. I.e. it is very much a function, just anonymous.

An instance of a lambda can be assigned to any functional interface 
 whose single abstract method’s definition matches the definition of the lambda. In fact, a lambda is a less verbose way of defining an instance of an interface provided the interface is functional. Since, the definition of a lambda can match the definition of multiple functional interfaces, hence, a lambda instance can be assigned to any of these matching interfaces.

The reason i picked this topic was because it was something new i have seen in the java language. Also wanted to know more about it and see if i can utilized it on some of my java programming language.

Examples of lambda expression.

First of all. Comparing java 7 to java 8.

public interface StateChangeListener {

public void onStateChange(State oldState, State newState);

}

In java 7 we implement this interface in order to listen for state changes. You do this

public class StateOwner {

public void addStateListener(StateChangeListener listener) { … }

}

But in java 8 you can add an event listener using a java lambda expression. like this.

StateOwner stateOwner = new StateOwner();

stateOwner.addStateListener(

(oldState, newState) -> System.out.println(“State changed”)

);

 

From this topic ( lambda expressions), i learned that previous java or java 7, if i wanted a block of code to be executed, we need to create an object and pass the object around. From Java 8, lambda expressions enable us to treat functionality as method argument and pass a block of code around. Lambda expressions in Java 8 are very powerful and therefore very compelling. For me, lambda expressions is way much better, convenient and very easy.

link to the resource : http://tutorials.jenkov.com/java/lambda-expressions.html