Hibernate
Народ, есть тут кто то с опытом в Hibernate?
У меня несколько вопросов по дизайну/best practices - буду благодарен если кто то ответит
1. Are you using the same data objects both in persistence layer (Hibernate) and GUI (Swing rich client)? Are your GUI programmers use data objects "as is" or extend them? How do you ensure that setters are called in Hibernate only, not in GUI?
2. I implemented data objects state change in DAOs only – in order to ensure that every change in every object will be persistent immediately. Is it a good idea?
3. I'm using Spring HibernateTemplate for hibernate, it saves a lot of exception handling code, but what is the best way to handle error situations in this case?
4. What is the best way to create mockup objects for unit tests? If in my code objects ids are assigned by a database, where and who should assign id for mockup objects?
Спасибо!
У меня несколько вопросов по дизайну/best practices - буду благодарен если кто то ответит
1. Are you using the same data objects both in persistence layer (Hibernate) and GUI (Swing rich client)? Are your GUI programmers use data objects "as is" or extend them? How do you ensure that setters are called in Hibernate only, not in GUI?
2. I implemented data objects state change in DAOs only – in order to ensure that every change in every object will be persistent immediately. Is it a good idea?
3. I'm using Spring HibernateTemplate for hibernate, it saves a lot of exception handling code, but what is the best way to handle error situations in this case?
4. What is the best way to create mockup objects for unit tests? If in my code objects ids are assigned by a database, where and who should assign id for mockup objects?
Спасибо!
