If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!
Tuesday, April 15, 2014
Saturday, April 12, 2014
Friday, April 11, 2014
Thursday, April 10, 2014
Wednesday, April 9, 2014
Friday, April 4, 2014
Ceylon: annotations
What is an annotation?
An annotation is a top level function that returns a subtype of ConstrainedAnnotation.
There are 2 interfaces which satisfy ConstrainedAnnotation directly:
Let's see the type hierarchy of ConstrainedAnnotation to get a better picture.
So what you might have thought to be reserved keywords (shared, formal, actual, ...) are in fact annotations used by the compiler. Let's see how the DocAnnotation is implemented.
An annotation is a top level function that returns a subtype of ConstrainedAnnotation.
There are 2 interfaces which satisfy ConstrainedAnnotation directly:
- OptionalAnnotation: An annotation that may occur at most once at a single program element and only on certain program elements.
- SequencedAnnotation: An annotation that may occur multiple times at a single program element, and only on certain program elements.
Let's see the type hierarchy of ConstrainedAnnotation to get a better picture.
Labels:
Ceylon
Wednesday, April 2, 2014
Using Java's FutureTask to execute Callable tasks concurrently
In this demo we have 2 Case Providers, one for Activiti and one for WPS. I used Thread.sleep to mimic a time consuming computation (e.g. IO). Now we want to have a composite Case Provider which composes cases from both case providers. However, as we naively implement this in SequentialCaseProvider we will see that the total time it takes is the sum of having the 2 caseproviders fetch the cases (9 seconds). By using a concurrent approach in ConcurrentCaseProvider, we can reduce the time to +- the time it takes the longest CaseProvider to fetch the cases. (5 seconds)
Labels:
java
Subscribe to:
Posts (Atom)