afedulov commented on a change in pull request #211:
URL: https://github.com/apache/flink-statefun/pull/211#discussion_r595073904



##########
File path: docs/content/docs/sdk/java.md
##########
@@ -29,451 +29,395 @@ under the License.
 Stateful functions are the building blocks of applications; they are atomic 
units of isolation, distribution, and persistence.
 As objects, they encapsulate the state of a single entity (e.g., a specific 
user, device, or session) and encode its behavior.
 Stateful functions can interact with each other, and external systems, through 
message passing.
-The Java SDK is supported as an [embedded module]({{< ref 
"docs/sdk/overview#embedded-module" >}}).
 
 To get started, add the Java SDK as a dependency to your application.
 
-{{< artifact statefun-sdk >}}
+{{< artifact statefun-sdk-java >}}
 
 ## Defining A Stateful Function
 
-A stateful function is any class that implements the ``StatefulFunction`` 
interface.
-The following is an example of a simple hello world function.
+A stateful function is any class that implements the `StatefulFunction` 
interface.
+In the following example, a `StatefulFunction` maintains a count for every user
+of an application, emitting a customized greeting.
 
 ```java
-package org.apache.flink.statefun.docs;
-
-import org.apache.flink.statefun.sdk.Context;
-import org.apache.flink.statefun.sdk.StatefulFunction;
-
-public class FnHelloWorld implements StatefulFunction {
+import java.util.concurrent.CompletableFuture;
+import org.apache.flink.statefun.sdk.java.Context;
+import org.apache.flink.statefun.sdk.java.StatefulFunction;
+import org.apache.flink.statefun.sdk.java.TypeName;
+import org.apache.flink.statefun.sdk.java.ValueSpec;
+import org.apache.flink.statefun.sdk.java.message.Message;
 
-       @Override
-       public void invoke(Context context, Object input) {
-               System.out.println("Hello " + input.toString());
-       }
-}
-```
+public class GreeterFn implements StatefulFunction {
 
-Functions process each incoming message through their ``invoke`` method.
-Input's are untyped and passed through the system as a ``java.lang.Object`` so 
one function can potentially process multiple types of messages.
+    static final TypeName TYPE = 
TypeName.forNameFromString("com.example.fns/greeter");

Review comment:
       forNameFromString  => typeNameFromString




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to