Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few README fixes #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository contains a generic definition of the observer pattern for Java.

Currently Java only contains the `java.util.Observable` class that is part since Java 1 and it's
functionality and API don't use modern Java languages features and APIs like generics, functional
interfaces or Optional. In additional this API will become deprecated in Java 9.
interfaces or Optional. In addition, this API will become deprecated in Java 9.
Based on this it's quite hard to work with this implementation and mostly
all modern Java framework don't use it. Instead custom implementations of the observer pattern
can be found in mostly all frameworks. Even in JavaSE you can find custom implementations of the
Expand Down Expand Up @@ -36,8 +36,8 @@ support values must be wrapped in a class to support the observer pattern. There
will be triggered whenever the internal value will change:

```java
Observable<Date> observer = ...
observer.onChanged(e -> System.out.println("Value has changed!"));
Observable<Date> observable = ...
observable.onChanged(e -> System.out.println("Value has changed!"));
```

Instead of having `addListener(...)` and `removeListener(...)` methods like in several Java APIs the
Expand All @@ -46,8 +46,8 @@ the listener:


```java
Observable<Date> observer = ...
Subscription subscription = observer.onChanged(e -> System.out.println(e.getNewValue()));
Observable<Date> observable = ...
Subscription subscription = observable.onChanged(e -> System.out.println(e.getNewValue()));

//later
subscription.unsubscribe();
Expand All @@ -57,7 +57,7 @@ subscription.unsubscribe();

The API provides the 2 base interfaces `com.guigarage.observer.collection.ObservableList` and
`com.guigarage.observer.collection.ObservableSet` that can be used to provide the observer pattern
for collections. The following examle shows how an observable list can be used:
for collections. The following example shows how an observable list can be used:

```java
ObservableList<String> list = ...
Expand Down