From 5fdd04581f21e47c2b11ee3350cc85b3e314cac0 Mon Sep 17 00:00:00 2001 From: Lennart Hensler Date: Tue, 18 Aug 2015 14:56:27 +0200 Subject: [PATCH] Improved the data mining wiki page --- wiki/typical-data-mining-scenarios.md | 16 ++++++++++++---- wiki/typical-development-scenarios.md | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/wiki/typical-data-mining-scenarios.md b/wiki/typical-data-mining-scenarios.md index 130e319c1e2..ea6404a2e2f 100644 --- a/wiki/typical-data-mining-scenarios.md +++ b/wiki/typical-data-mining-scenarios.md @@ -19,6 +19,9 @@ * Create a `ResourceBundleStringMessages` in the `DataMiningBundleService` * The `ResourceBundleStringMessages` needs the resource base name, which should be `/` * A reference to this `ResourceBundleStringMessages` should be returned by the method `getStringMessages()` +* **[Optional]** It may be necessary to implement GWT specific components for the new Data Mining Bundle, like DTOs or a [Serialization Dummy](wiki/typical-data-mining-scenarios#Include-a-Type-forcefully-in-the-GWT-Serialization-Policy). + * This should be done in a separate bundle. + * See [Typical Development Scenarios](wiki/typical-development-scenarios#Adding-a-shared-GWT-library-bundle) for instructions, how to add a shared GWT bundle. ## Adding an absolute new Data Type @@ -120,9 +123,14 @@ It can happen, that a necessary type isn't included in the GWT Serialization Pol * Create a dummy class in a shared bundle, if such a dummy class doesn't exist already in the scope of the type. * For example like `SSEDataMiningSerializationDummy`. - * The class has to implement `Serializable` and should only have a private standard constructor, to prevent an accidental instantiation. + * The class has to implement the interface `SerializationDummy` and should only have a private standard constructor, to prevent an accidental instantiation. + * Implementing this interface adds the dummy automatically to the serialization policy, without changing the `DataMiningService`. * Add a private non-final instance variable of the type to the dummy. -* Add a pseudo method to the GWT-Service, that uses the dummy class, if such a method doesn't exist already. - * For example like `SSEDataMiningSerializationDummy pseudoMethodSoThatSomeSSEDataMiningClassesAreAddedToTheGWTSerializationPolicy()`. -The type will be included in the GWT Serialization Policy, because the GWT-Service has a method, that uses the dummy class, that uses the type. \ No newline at end of file +The type will be included in the GWT Serialization Policy, because the `DataMiningService` has a method, that uses the interface `SerializationDummy`, that uses the type. + +If you can't implement `SerializationDummy` for any reasons do the following: + +* Implement the interface `Serializable` or `IsSerializable` instead. +* Add a pseudo method to the GWT-Service, that uses the dummy class. + * For example like `SerializationDummy pseudoMethodSoThatSomeClassesAreAddedToTheGWTSerializationPolicy()`. \ No newline at end of file diff --git a/wiki/typical-development-scenarios.md b/wiki/typical-development-scenarios.md index 8b15d5bd325..e46af45a393 100644 --- a/wiki/typical-development-scenarios.md +++ b/wiki/typical-development-scenarios.md @@ -68,12 +68,14 @@ Sometimes we need a bundle containing code and resources which can be used by ot To create and use such a bundle from another GWT bundle (e.g. com.sap.sailing.gwt.ui) some additional steps compared to the normal Java bundle creation are required. GWT library bundle project creation + * Add a new Java plugin project, using /java/ as the project directory * Add the GWT-SDK dependency to the project * Add a GWT module file to project (ModuleName.gwt.xml) * Add the bundle to the main pom.xml in /git/java Use the GWT library project in a GWT UI project + * Add the src folder of the GWT library bundle to classpath of all GWT-Launch configurations (required to let the GWT dev mode find the sources of java classes) -> Open GWT launch config, select tab 'classpath', select 'User entries', click 'Advanced' button, choose 'add folders' option and add the src folder of the GWT library project * Add the bundle the pom.xml of the GWT UI project (for the maven build)