Translate

пʼятницю, 28 січня 2011 р.

Конкурс для розробників під Android


Отримав ось такий лист

Друзі, вітаю!
Сподіваюсь для вас цікавою буде новина про старт другого етапу конкурсу Android розробників – HTC Android Developers Contest 2.0.
Будемо дуже раді, якщо ви зможете проанонсувати її на вашій спільноті для своїх колег!
Тако всю інформацію можна знайти на сайті: http://htc-android.com.ua/ 




Додаткова інфа тут і тут

середу, 26 січня 2011 р.

Героїв треба знати в лице - Top 8 Java People You Should Know


Here are the top 8 Java people, they’re created frameworks, products, tools or books that contributed to the Java community, and changed the way of coding Java.
P.S The order is based on my personal priority.

8. Tomcat & Ant Founder

James-Duncan-Davidson
James Duncan Davidson, while he was software engineer at Sun Microsystems (1997–2001), created Tomcat Java-based web server, still widely use in most of the Java web projects, and also Ant build tool, which uses XML to describe the build process and its dependencies, which is still the de facto standard for building Java-based Web applications.
Related Links
  1. James Duncan Davidson Twitter
  2. James Duncan Davidson Wiki
  3. James Duncan Davidson personal blog
  4. Apache Ant
  5. Apache Tomcat

7. Test Driven Development & JUnit Founder

Kent-Beck
Kent Beck, creator of the Extreme Programming and Test Driven Development software development methodologies. Furthermore, he and Erich Gamma created JUnit, a simple testing framework, which turn into the de facto standard for testing Java-based Web applications. The combine of JUnit and Test Driven Development makes a big changed on the way of coding Java, which causes many Java developers are not willing to follow it.
Related Links
  1. Kent Beck Twitter
  2. Kent Beck Wiki
  3. Kent Beck Blog
  4. JUnit Testing Framework
  5. Extreme Programming Wiki
  6. Test Driven Development Wiki
News & Interviews
  1. Kent Beck: “We thought we were just programming on an airplane”
  2. Interview with Kent Beck and Martin Fowler
  3. eXtreme Programming An interview with Kent Beck
Kent Beck Books
  1. Extreme Programming Explained: Embrace Change (2nd Edition)
  2. Refactoring: Improving the Design of Existing Code
  3. JUnit Pocket Guide

6. Java Collections Framework

Joshua-Bloch
Joshua Bloch, led the design and implementation of numerous Java platform features, including JDK 5.0 language enhancements and the award-winning Java Collections Framework. In June 2004 he left Sun and became Chief Java Architect at Google. Furthermore, he won the prestigious Jolt Award from Software Development Magazine for his book, “Effective Java”, which is arguably a must read Java’s book.
Related Links
  1. Joshua Bloch Twitter
  2. Joshua Bloch Wiki
News & Interviews
  1. Effective Java: An Interview with Joshua Bloch
  2. Rock Star Josh Bloch
Joshua Bloch Books
  1. Effective Java (2nd Edition)
  2. Java Concurrency in Practice

5. JBoss Founder

Marc-Fleury
Marc Fleury, who founded JBoss in 2001, an open-source Java application server, arguably the de facto standard for deploying Java-based Web applications. Later he sold the JBoss to RedHat, and joined RedHat to continue support on the JBoss development. On 9 February 2007, he decided to leave Red Hat to pursue other personal interests, such as teaching, research in biology, music and his family.
Related Links
  1. Marc Fleury Wiki
  2. Marc Fleury Blog
  3. JBoss Application Server
News & Interviews
  1. Could Red Hat lose JBoss founder?
  2. JBoss founder Marc Fleury leaves Red Hat, now what?
  3. JBoss’s Marc Fleury on SOA, ESB and OSS
  4. Resurrecting Marc Fleury

4. Struts Founder

Craig-McClanahan
Craig Mcclanahan, creator of Struts, a popular open source MVC framework for building Java-based web applications, which is arguably that every Java developer know how to code Struts. With the huge success of Struts in early day, it’s widely implemented in every single of the old Java web application project.
Related Links
  1. Craig Mcclanahan Wiki
  2. Craig Mcclanahan Blog
  3. Apache Struts
News & Interviews
  1. Interview with Craig McClanahan
  2. Struts Or JSF?

3. Spring Founder

Rod-Johnson
Rod Johnson, is the founder of the Spring Framework, an open source application framework for Java, Creator of Spring, CEO at SpringSource. Furthermore, Rod’s best-selling Expert One-on-One J2EE Design and Development (2002) was one of the most influential books ever published on J2EE.
Related Links
  1. Rod Johnson Twitter
  2. Rod Johnson Blog
  3. SpringSource
  4. Spring Framework Wiki
News & Interviews
  1. VMware.com : VMware to acquire SpringSource
  2. Rod Johnson : VMware to acquire SpringSource
  3. Interview with Rod Johnson – CEO – Interface21
  4. Q&A with Rod Johnson over Spring’s maintenance policy changes
  5. Expert One-on-One J2EE Design and Development: Interview with Rod Johnson
Rod Johnson Books
  1. Expert One-on-One J2EE Design and Development (Programmer to Programmer)
  2. Expert One-on-One J2EE Development without EJB

2. Hibernate Founder

gravin-king
Gavin King, is the founder of the Hibernate project, a popular object/relational persistence solution for Java, and the creator of Seam, an application framework for Java EE 5. Furthermore, he contributed heavily to the design of EJB 3.0 and JPA.
Related Links
  1. Gavin King Blog
  2. Hibernate Wiki
  3. Hibernate Framework
  4. JBoss seam
News & Interviews
  1. Tech Chat: Gavin King on Contexts and Dependency Injection, Weld, Java EE 6
  2. JPT : The Interview: Gavin King, Hibernate
  3. JavaFree : Interview with Gavin King, founder of Hibernate
  4. Seam in Depth with Gavin King
Gavin King Books
  1. Java Persistence with Hibernate
  2. Hibernate in Action (In Action series)

1. Father of the Java programming language

James-Gosling
James Gosling, generally credited as the inventor of the Java programming language in 1994. He created the original design of Java and implemented its original compiler and virtual machine. For this achievement he was elected to the United States National Academy of Engineering. On April 2, 2010, he left Sun Microsystems which had recently been acquired by the Oracle Corporation. Regarding why he left, Gosling wrote on his blog that “Just about anything I could say that would be accurate and honest would do more harm than good.”
Related Links
  1. James Gosling Blog
  2. James Gosling Wiki
News & Interviews
  1. Interview with Dennis Ritchie, Bjarne Stroustrup, and James Gosling
  2. Interview: James Gosling, ‘the Father of Java’
  3. Developer Interview: James Gosling


JSF Sucks


Надибав цікавий пост з переліком негативних відгуків про JSF з простою назвою JSF Sucks
Кумедно що навіть є сторінка http://ihatejsf.com/ де можна лишити фідбек
Заради обєктивності подам лінк на пост-відповідь де автор пробує захистити JSF




вівторок, 25 січня 2011 р.

New line character


Для тих хто не знає.  Кожна операційна система має свій символ позначення нового рядка
Для того щоб у джаві правильно вставити символ нового рядка спочатку тре його отримати наступним чином

public static String newline = System.getProperty("line.separator");

так що користуйтесь цим способом коли хочете щоб ваша аплікація була кросплатформна

середу, 19 січня 2011 р.

JSF1.2 if...else.. statement


Як що вам потрібно буде використати  if..else.. у JSF 1.2  не пробуйте використати jstl
на зразок ось так
 <c:choose>
    <c:when test='${param.p == "someValue"}'>
        Generate this template text if p equals someValue
    </c:when>
    <c:otherwise>
        Otherwise generate this template text
    </c:otherwise>
</c:choose>
це не працює
краще зробіть отак

<h:outputText value="#{Enabled}"
                        rendered="#{action.val1 eq action.val2}" />

<h:outputText value="#{Disabled}"
                        rendered="#{action.val1 ne action.val2}" />


вівторок, 18 січня 2011 р.

Hacking the enum conversion in JSF 1.2_x


Сьогодні зіткнувся з тим що JSF 1.2 неправильно працює з енумами
Трохи пошукав і знайшов ось тут рішеня і навіть дет
Suppose you have an enum and some of its methods are overridden by concrete enum values:
public enum SomeEnum {
    SOME_VALUE,
    OTHER_VALUE {
        @Override
        public boolean isDifferent() {
            return true;
        }
    };
 
    public boolean isDifferent() {
        return false;
    }
}
In the example a custom isDifferent() method is overridden, but it could as well be the existing toString().
If you attempt to use such an Enum (the OTHER_VALUE to be precise) within a view in a JSF application (using the reference implementation, haven’t tried MyFaces), you’re likely to get an exception like this:
javax.faces.convert.ConverterException: 'OTHER_VALUE' must be convertible
    to an enum from the enum, but no enum class provided.
After some debugging it turns out that enum values with non-empty body are not handled properly. If you have a look at the com.sun.faces.application.ApplicationImpl class, there’s a method
public Converter createConverter(Class targetClass) {
    ...
}
Normally, when JSF is looking for a converter for an enum without overridden values, the targetClass parameter is the concrete enum class (it should be SomeEnum in our case, but it actually is SomeEnum$Something). The method first tries to lookup a base type converter, but there’s none for SomeEnum$Something (that’s a surprise!). So, in the next attempt, it searches for interfaces implemented by the targetClass – but nothing here again. As a last resort, the method goes through a collection of targetClass’s superclasses. This time a superclass is found – it’s the SomeEnum – so the
protected Converter createConverterBasedOnClass(
            Class targetClass, Class baseClass) {
    ...
}
method is called with SomeEnum as the targetClass and SomeEnum$Something as the baseClass. Similar steps as above are now taken to find and appropriate converter for interfaces/superclasses of SomeEnum. As SomeEnum extends java.lang.Enum, the method is called recursively with null as the baseClass:
createConverterBasedOnClass(java.lang.Enum, null);
Finally, a matching converter is found for java.lang.Enum and an instance of javax.faces.convert.EnumConverter is created. Almost everything is fine, except for the fact that it gets the above null (passed as the baseClass above) injected as the target class in constructor parameter.
This causes the converter to throw the exception mentioned above when assuring that its target class is not null:
if (targetClass == null) {
    throw new ConverterException(MessageFactory.getMessage(
              context,
              ENUM_NO_CLASS_ID,
              value,
              MessageFactory.getLabel(context, component))
    );
}
Unlike the problem description, the solution seems to be quite simple. What we basically need to do is to handle the case when JSF is looking for a converter for an anonymous inner class of an enum and swap the classes in the call to createConverterBasedOnClass(). So if the tagetClass is our enum and the baseClass is its anonymous extension, we should call:
createConverterBasedOnClass(Enum.class, targetClass);
otherwise we shouldn’t change anything and call:
createConverterBasedOnClass(targetClass, baseClass);
To weave our solution into JSF we need to extend the com.sun.faces.application.ApplicationImpl class and override its createConverterBasedOnClass() method:
package org.kunicki.jsf;
 
import com.sun.faces.application.ApplicationImpl;
 
import javax.faces.convert.Converter;
 
/**
 * @author jacek@kunicki.org
 */
public class FixedEnumConverterApplicationImpl
    extends ApplicationImpl {
 
    @Override
    protected Converter createConverterBasedOnClass(
            Class targetClass, Class baseClass) {
        // if base class is an anonymous  inner class of an
        // enum, use Enum as the target class and targetClass
        // as the base class
        if (targetClass.isEnum()
                && baseClass.getName().contains(
                      targetClass.getName())
                && baseClass.getName().contains("$")) {
            return super.createConverterBasedOnClass(
                      Enum.class, targetClass);
        } else {
            return super.createConverterBasedOnClass(
                      targetClass, baseClass);
        }
    }
}
Now we need make JSF use the above implementation instead of the standard one. This is done by extending the com.sun.faces.application.ApplicationFactoryImpl and override the getApplication() method to simply return our FixedEnumConverterApplicationImpl:
package org.kunicki.jsf;
 
import com.sun.faces.application.ApplicationFactoryImpl;
import com.sun.faces.util.FacesLogger;
 
import javax.faces.application.Application;
import java.text.MessageFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
 
/**
 * @author jacek@kunicki.org
 */
public class FixedEnumConverterApplicationFactoryImpl
    extends ApplicationFactoryImpl {
 
    private Application application;
    private static final Logger logger =
        FacesLogger.APPLICATION.getLogger();
 
    @Override
    public Application getApplication() {
        if (application == null) {
            application =
                new FixedEnumConverterApplicationImpl();
            if (logger.isLoggable(Level.FINE)) {
                logger.fine(MessageFormat.format(
                    "Created Application instance ''{0}''",
                    application)
                );
            }
        }
 
        return application;
    }
}
The final step is to register a custom application factory in faces-config.xml:
<factory>
<application-factory>
org.kunicki.jsf.FixedEnumConverterApplicationFactoryImpl
</application-factory>
</factory>
So, this one worked for me. Of course you can simply avoid overriding methods in your enums or perhaps use MyFaces, which may not contain this bug. If you think this is a nice or bad solution, please leave a comment.




суботу, 15 січня 2011 р.

Java Web Frameworks Comparison


Надибав сьогодні доволі цікаву матрицю порівняння фреймворків
Якщо перейти за посиланням то можна також переглянути зважену матрицю яка можливо більш обєктивна

Criteria
Struts 2
Spring MVC
Wicket
JSF 2
Tapestry
Stripes
GWT
Grails
Rails
Flex
Vaadin
Lift
Play
Developer Productivity
0.50
0.50
0.50
0.50
1.00
0.50
1.00
1.00
1.00
0.00
1.00
0.50
1.00
Developer Perception
0.50
1.00
1.00
0.00
0.50
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
Learning Curve
1.00
1.00
0.50
0.50
0.50
1.00
1.00
1.00
1.00
1.00
1.00
0.50
1.00
Project Health
0.50
1.00
1.00
1.00
0.50
0.50
1.00
1.00
1.00
0.50
1.00
1.00
1.00
Developer Availability
0.50
1.00
0.50
1.00
1.00
0.50
1.00
0.50
1.00
1.00
0.50
0.00
0.50
Job Trends
1.00
1.00
0.00
1.00
0.50
0.00
1.00
0.50
1.00
1.00
0.00
0.00
0.50
Templating
1.00
1.00
1.00
0.50
1.00
1.00
0.50
1.00
1.00
0.50
0.50
0.50
0.50
Components
0.00
0.00
1.00
1.00
1.00
0.00
0.50
0.50
0.50
1.00
1.00
0.00
0.00
Ajax
0.50
1.00
0.50
0.50
0.50
0.50
1.00
0.50
0.50
0.50
1.00
1.00
0.50
Plugins or Add-Ons
0.50
0.00
1.00
1.00
0.50
0.00
1.00
1.00
1.00
1.00
1.00
0.50
1.00
Scalability
1.00
1.00
0.50
0.50
0.50
1.00
1.00
0.50
0.50
0.50
0.50
1.00
1.00
Testing
1.00
1.00
0.50
0.50
1.00
1.00
0.50
1.00
1.00
0.00
0.50
0.50
1.00
i18n and l10n
1.00
1.00
1.00
0.50
1.00
1.00
1.00
1.00
0.50
0.50
1.00
1.00
1.00
Validation
1.00
1.00
1.00
0.50
1.00
1.00
1.00
1.00
1.00
1.00
1.00
0.50
0.50
Multi-language Support (Groovy / Scala)
0.50
0.50
1.00
1.00
1.00
1.00
0.00
1.00
0.00
0.00
1.00
0.00
0.50
Quality of Documentation/Tutorials
0.50
1.00
0.50
0.50
0.50
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
Books Published
1.00
1.00
0.50
1.00
0.50
0.50
1.00
1.00
1.00
1.00
0.50
0.50
0.00
REST Support (client and server)
0.50
1.00
0.50
0.00
0.50
0.50
0.50
1.00
1.00
0.50
0.50
0.50
0.50
Mobile / iPhone Support
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
0.50
1.00
1.00
1.00
Degree of Risk
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
0.50
0.50
0.50
Totals
14.5
17
14.5
13.5
15
14
17
17.5
17
13.5
15.5
11.5
14

http://spreadsheets.google.com/pub?key=0AtkkDCT2WDMXdC1HOEtnUHpCejJMbUhGeGJWUmh5dVE&hl=en&gid=0

Ratings Logic
http://bit.ly/jvm-webfwk-ratings-logic
 More Information: http://raibledesigns.com/rd/entry/how_i_calculated_ratings_for



Top JVM Web Frameworks
Top at RWX 2010
Top at Devoxx 2010
Grails
Grails
GWT
GWT
GWT
Rails
Rails
Rails
Spring MVC
Spring MVC
Spring MVC
Grails
Vaadin
Tapestry / Vaadin
Wicket / Struts 2
Ось презентація в продовження теми порівняння фреймворків
А це кілька посилань на обговорення даної матриці
Tapestry: http://blog.tapestry5.de/index.php/2010/11/21/response-to-matt-raibles-presentation-at-devoxx-2010/

Vaadin: https://twitter.com/#!/joonaslehtinen/status/7394450594594816, https://twitter.com/#!/joonaslehtinen/status/7394693067317248, https://twitter.com/#!/joonaslehtinen/status/7395430384017408

Vaadin: http://www.logemann.org/2010/11/on-matt-raibles-web-framework.html

Play: https://twitter.com/#!/nmartignole/status/7472975041269760

Для мене особливо цікавим було обговорення JSF фанатів ))
http://mkblog.exadel.com/2010/12/jvm-web-frameworks-comparison-reply-to-jsf-scoring/
Не знаю як друга версія фейсів але перша - паскудство рідкісне. Не впевнений що другі стали зручніші, але надіюсь хоча б більш адекватні