|
|||||||
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
I really love Java Bean support, especially the solution with the @BEAN annotation. It is awesome that you can use a POJO which doesn't implement ModelData or anything else from GXT and that you don't have to manage with the get/set properties stuff. You can find some information here : http://extjs.com/blog/2008/07/14/preview-java-bean-support-with-ext-gwt/
However, we still have to create an interface extending BeanModelMarker and then annotating it with our bean class (e.g. @BEAN(Customer.class) public interface CustomerBeanModel...). This way we don't have to modify our bean class but I'm not sure we can really be happy with creating an interface for each POJO class. Ok, you can tell me "you can make your bean implementing BeanModelTag instead of creating a new interface", but if I have to introduce a GXT dependency in my POJO class, I would definitely rather use an annotation than an interface. I'd like to know what do you think about it ? Do you like creating an interface so that you don't have to modify your POJO class (you don't want to introduce any GXT dependency in your POJOs, even an annotation) or would you rather put the annotation directly in your POJO class (because it is quicker and because an annotation is a weak dependency) ? Or maybe you don't care about implementing BeanModelTag ? By the way, in the blog post, I read Quote:
|
|
#2
|
|||
|
|||
|
Hi,
+1. It wouldn't be possible to just add the annotation on the POJO classes instead of creating interfaces ??? |
|
#3
|
|||
|
|||
|
For my part i can live with implementing the BeanModelTag. It works very fine for me and doesn't harm at all.
@Entity
@Table(name = "USER")
public class User extends LightEntity implements BeanModelTag, Serializable {
private static final long serialVersionUID = 2776494633319384131L;
@Id
@GeneratedValue
@Column(name = "ID", unique = true, nullable = false)
private Integer id;
@Column(name = "LOGIN", unique = true, nullable = false, length = 20)
private String login;
....
..
.
regards |
|
#4
|
|||
|
|||
|
What I don't like with the BeanModelTag solution is that you introduce a GXT dependency in your POJOs. Then you can't just reuse these classes in a similar project which doesn't use GXT. In my case, I have a "core" project/module which has the business entities (aka domain objects, POJOs) and the business services, so no GXT dependency in this project. Then I have the web module which depends on the core module and on GXT.
|
|
#5
|
|||
|
|||
|
Quote:
agree ![]() |
|
#6
|
|||
|
|||
|
I've a similar problem. I have entities grouped in a jar and return them from EJB methods. Deploy of entities jar on JBOSS is OK. The problem is that if I try use both methods (@BEAN or implements BeanModelTag) GWT give a NoClassDefFound Error, who can help me?
|
![]() |
| Thread Tools | |
|
|