I like the benefits.

There is just a minor thing why I like to mention:
> 3) Wildfly as well as Weblogic 12.1.3 are Java 8 certified AFAIK

No they are not afaik. Simply because the EE TCK does not work on Java8. 
Remember that each TCK always have to ensure that there are no additional 
methods on public API interfaces and classes. And with Java8 you sometimes get 
a bit more methods than with Java7. All those tests fail in Java8.

LieGrue,
strub



On Saturday, 29 November 2014, 10:30, Anatole Tresch <[email protected]> wrote:


>
>
>Hi Mark/all
>
>
>AFAIK Java 8 was a precondition even in the incubation proposal that we are 
>basing on Java 8, so I am basically suprised we have to discuss this at all.
>Nevertheless I will try to give some more extended feedback/insights on this 
>topic:
>
>
>1) the target is to build a modern API. If you want Java 7 and earlier support 
>use commons-configuration and add CDI support as a module on top of it.
>2) there are many developers that do not use Java EE anymore. We have as well 
>a huge Spring community, where adoption is much faster.
>3) Wildfly as well as Weblogic 12.1.3 are Java 8 certified AFAIK
>4) Adoption within one year will be great.
>5) Java 8 is more than Lambdas and streams!
>6) Java 8 is the future! And we design here for the future, we do not want to 
>be one additional config framework.
>
>
>I give you an example here, e.g. let us start on the PropertyProvider:
>
>
>In Java 8:
>
>
>
>public interface PropertyProvider {
>
>
>    Optional<String> get(String key);
>    boolean containsKey(String key);
>    Map<String, String> toMap();
>    MetaInfo getMetaInfo();
>
>
>    default boolean hasSameProperties(PropertyProvider provider) {...}
>    default Set<String> keySet(){...}
>    default ConfigChangeSet load(){...}
>    default boolean isMutable(){...}
>    default void apply(ConfigChangeSet change){...}
>}
>
>
>In Java 7:
>
>
>
>With Java 7 this would be (to provide similar comfort, but on the cost of 
>implementation dependencies and limited flexibility because of missing 
>behavioural inheritance):
>
>
>public interface PropertyProvider {
>
>
>    String get(String key); // @throws org.apache.tamaya.ConfigException if no 
> such value is defined !!!
>    String getOrDefault(String key, String value);
>
>
>    boolean containsKey(String key);
>    Map<String, String> toMap();
>    MetaInfo getMetaInfo();
>
>
>    default boolean hasSameProperties(PropertyProvider provider) {...}
>    default Set<String> keySet(){...}
>    default ConfigChangeSet load(){...}
>    default boolean isMutable(){...}
>    default void apply(ConfigChangeSet change){...}
>}
>
>
>protected abstract class AbstractPropertyProvider implements PropertyProvider {
>    public boolean hasSameProperties(PropertyProvider provider) {...}
>    public Set<String> keySet(){...}
>    public ConfigChangeSet load(){...}
>    public boolean isMutable(){...}
>    public void apply(ConfigChangeSet change){...}
>}
>
>
>Example 2: Configuration
>
>
>Looking at Configuration and the singleton access there things get even worse:
>
>
>In Java 8:
>
>
>
>public interface Configuration extends PropertyProvider{
>
>
>    <T> Optional<T> get(String key, Class<T> type);
>    void addPropertyChangeListener(PropertyChangeListener l);
>    void removePropertyChangeListener(PropertyChangeListener l);
>
>
>    default OptionalBoolean getBoolean(String key){... }
>    default OptionalInt getInteger(String key){... }
>    default OptionalLong getLong(String key){... }
>    default OptionalDouble getDouble(String key){...  }
>    default <T> Optional<T> getAdapted(String key, PropertyAdapter<T> 
> adapter){... }
>    default Set<String> getAreas(){... }
>    default Set<String> getTransitiveAreas(){... }
>    default Set<String> getAreas(final Predicate<String> predicate){... }
>    default Set<String> getTransitiveAreas(Predicate<String> predicate){... }
>    default boolean containsArea(String key){... }
>    default Configuration with(ConfigOperator operator){... }
>    default <T> T query(ConfigQuery<T> query){...}
>    default String getVersion(){...}
>
>
>    public static boolean isDefined(String name){...}
>   public static <T> T of(String name, Class<T> template){...}
>    public static Configuration of(String name){...}
>    public static Configuration of(){...}
>    public static <T> T of(Class<T> type){... }
>    public static void configure(Object instance){... }
>   public static String evaluateValue(String expression){... }
>    public static String evaluateValue(Configuration config, String 
> expression){...  }
>    public static void addGlobalPropertyChangeListener(PropertyChangeListener 
> listener){... }
>    public static void 
> removeGlobalPropertyChangeListener(PropertyChangeListener listener){...}
>}
>
>
>In Java 7:
>
>
>public interface Configuration extends PropertyProvider{
>    <T> T get(String key, Class<T> type); // throws ConfigException if not 
> found
>    <T> T getOrDefault(String key, Class<T> type, T instance);
>    void addPropertyChangeListener(PropertyChangeListener l);
>    void removePropertyChangeListener(PropertyChangeListener l);
>
>
>    boolean getBoolean(String key){... } // throws ConfigException if not found
>    boolean getBooleanOrDefault(String key, boolean defaultVal){... } 
>    int getInteger(String key){... }// throws ConfigException if not found
>    int getIntegerOrDefault(String key, int defaultVal){... } // throws 
> ConfigException if not found
>
>    long getLong(String key){... } // throws ConfigException if not found
>    long getLongOrDefault(String key, long defaultVal);
>    double getDouble(String key){... } // throws ConfigException if not found
>    double getDoubleOrDefault(String key, double defaultVal);
>    <T> getAdapted(String key, PropertyAdapter<T> adapter){... } // throws 
> ConfigException if not found
>    <T> getAdaptedOrDefault(String key, PropertyAdapter<T> adapter, T 
> defaultVal){... } // throws ConfigException if not found
>    Set<String> getAreas(){... }
>    Set<String> getTransitiveAreas(){... }
>    Set<String> getAreas(final Predicate<String> predicate){... } // Duplicate 
> predicate class, or introduce additional interface
>    Set<String> getTransitiveAreas(Predicate<String> predicate){... } // 
> Duplicate predicate class, or introduce additional interface
>    boolean containsArea(String key){... }
>    Configuration with(ConfigOperator operator){... }
>    <T> T query(ConfigQuery<T> query){...}
>    String getVersion(){...}
>}
>
>
>public final class ConfigManager{
>   private ConfigManager(){}
>
>
>    public static boolean isDefined(String name){...}
>    public static <T> T of(String name, Class<T> template){...}
>    public static Configuration of(String name){...}
>    public static Configuration of(){...}
>    public static <T> T of(Class<T> type){... }
>    public static void configure(Object instance){... }
>   public static String evaluateValue(String expression){... }
>    public static String evaluateValue(Configuration config, String 
> expression){...  }
>    public static void addGlobalPropertyChangeListener(PropertyChangeListener 
> listener){... }
>   public static void 
> removeGlobalPropertyChangeListener(PropertyChangeListener listener){...}
>}
>
>
>protected abstract class AbstractConfiguration extends 
>AbstractPropertyProvider implements Configuration{
>    boolean getBoolean(String key){... } // throws ConfigException if not found
>    boolean getBooleanOrDefault(String key, boolean defaultVal){... } 
>    int getInteger(String key){... }// throws ConfigException if not found
>    int getIntegerOrDefault(String key, int defaultVal){... } // throws 
> ConfigException if not found
>
>    long getLong(String key){... } // throws ConfigException if not found
>    long getLongOrDefault(String key, long defaultVal);
>    double getDouble(String key){... } // throws ConfigException if not found
>    double getDoubleOrDefault(String key, double defaultVal);
>    <T> getAdapted(String key, PropertyAdapter<T> adapter){... } // throws 
> ConfigException if not found
>    <T> getAdaptedOrDefault(String key, PropertyAdapter<T> adapter, T 
> defaultVal){... } // throws ConfigException if not found
>    public Set<String> getAreas(){... }
>    public Set<String> getTransitiveAreas(){... }
>    public Set<String> getAreas(final Predicate<String> predicate){... }
>    public Set<String> getTransitiveAreas(Predicate<String> predicate){... }
>    public boolean containsArea(String key){... }
>    public Configuration with(ConfigOperator operator){... }
>    public <T> T query(ConfigQuery<T> query){...}
>    public String getVersion(){...}
>}
>
>
>And even when looking from the client side:
>
>
>Java 8:
>
>
>String value = 
>Configuration.of().get("a.b.c").orElse(MyClass::calculateDefault);
>
>
>Java 7:
>
>
>String value = ConfigurationManager.getConfiguration().getOrDefault("a.b.c", 
>null);
>if(value==null){
>  value = calculateDefault();
>}
>
>
>So obviously the strength of Java 8 are far beyond Streams and Lambdas:
>    * The API footprint for clients overall is half the size.
>
>    * The implementations of APIs/SPIs is much more easier and does not 
> introduce implementation dependencies on abstract classes
>    * Users must known much less artefacts to use the API!
>    * It is much more flexible and extendable (see method references)
>    * ...
>The above case with the deferred calculation is additionally a simple but 
>common use case for Lambda usage. Considering implementation use cases like 
>filtering and mapping/combining
>of configuration to other things Streams are incredibly useful as well. 
>Similarly we would loose for sure great support from some of the most 
>communities like SouJava and LJC.
>
>
>So I hope I have now convinced really everybody here on the list that it is 
>NOT worth to stick on Java 7, just because we would have faster adoption ;-) !
>
>
>Cheers,
>Anatole
>
>
>
>
>
>
>2014-11-29 9:18 GMT+01:00 Mark Struberg <[email protected]>:
>
>This is a really tough question. We should step back a few meters and look at 
>it from a distance.
>>
>>What are the benefits? What are the downsides?
>>
>>Pro:
>>* more modern look&feel in our code
>>
>>* streams
>>* lambdas
>>
>>Do we really need streams and lambdas for configuration? Do we already have a 
>>nice class which demonstrates how we envision it to look like?
>>
>>
>>Con:
>>* Java8 adoption is still not as far as you think. Many companies just 
>>switched to Java7
>>
>>* Almost ALL Companies are still doing productionwith Java EE6 servers. 
>>Simple because there is still not even an enterprise ready EE7 server on the 
>>market, right? GlassFish is NOT meant for production (no support), WildFly is 
>>still not EAP. And Wildfly itself has only a free developer license, all 
>>other uses are not allowed/you need a prod license for it. Tmax JEUS is the 
>>only EE7 server available for production use, but it is not widely used in 
>>the US and EU (it's more common in Asian countries I've heard). So if you 
>>like wait for EE8 to get production ready than I give you another 5 years...
>>
>>The benefit of targeting Java7 would be that we could almost immediately try 
>>it out and even use it in TomEE, Wildfly, etc.
>>
>>Otoh we already have the DeltaSpike Configuration system which is pretty 
>>similar from an end user view.
>>
>>I'm fine with both ways. If it's only for saying we are Java8 then it's not 
>>worth it. If we find some great improvements by using lambdas and streams 
>>then I'm pro using Java8 only.
>>
>>
>>LieGrue,
>>strub
>>
>>
>>
>>
>>
>>
>>
>>> On Friday, 28 November 2014, 23:48, Oliver B. Fischer 
>>> <[email protected]> wrote:
>>> > +1 for Java 8. It will take some time to reach a widely accepted state
>>> with Tamaya. At this time Java 8 will be used by a wider range of
>>> people. Furthermore for such a project as ours we shouldn't restrict us
>>> with Java 7. Java 8 offers much more possibilities and features we could
>>> benefit from.
>>>
>>> Oliver
>>>
>>>
>>> Am 28.11.14 18:19, schrieb Romain Manni-Bucau:
>>>>  Hi guys,
>>>>
>>>>  just checkouted sources and seems project targets java 8. Don't we
>>>>  want to support java 7 as well? Otherwise it can be a blocker for
>>>>  adaption I think
>>>>
>>>>
>>>>  Romain Manni-Bucau
>>>>  @rmannibucau
>>>>  http://www.tomitribe.com
>>>>  http://rmannibucau.wordpress.com
>>>>  https://github.com/rmannibucau
>>>
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E [email protected]
>>> S oliver.b.fischer
>>> J [email protected]
>>> X http://xing.to/obf
>>>
>>
>
>
>
>-- 
>
>Anatole Tresch
>Java Engineer & Architect, JSR Spec Lead
>Glärnischweg 10
>CH - 8620 Wetzikon
>
>
>Switzerland, Europe Zurich, GMT+1
>Twitter:  @atsticks
>Blogs: http://javaremarkables.blogspot.ch/
>Google: atsticks
>Mobile  +41-76 344 62 79
>
>

Reply via email to