|
|
|
JavaBeans - что это?
|
|||
|---|---|---|---|
|
#18+
В модели MVC для реализации model (судя по книгам) используется JavaBean. Не могу понять в чем его отличие от обычного Java-класса. Я просто пишу свой класс, компилирую его и из JSP-страницы обращаюсь к нему? Или я должен обязательно реализовать какой-то интерфейс или унаследовать от чего-то, чтоб мой класс стал JavaBean? Чё то я запутался окончательно. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.11.2006, 23:26:17 |
|
||
|
JavaBeans - что это?
|
|||
|---|---|---|---|
|
#18+
http://en.wikipedia.org/wiki/JavaBeans JavaBeans JavaBeans are software components written in the Java programming language. The JavaBeans specification by Sun Microsystems defines them as "reusable software components that can be manipulated visually in a builder tool". In spite of many similarities, JavaBeans should not be confused with Enterprise JavaBeans (EJB), a server-side component technology that is part of Java EE. JavaBean conventions In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behavior. These conventions make it possible to have tools that can use, reuse, replace, and connect JavaBeans. The required conventions are: * The class should be serializable (able to persistently save and restore its state) * It should have a no-argument constructor * Its properties should be accessed using get, set and other methods following a standard naming convention * It should contain any required event-handling methods Because these requirements are largely expressed as conventions rather than by implementing interfaces, some developers view Java Beans as Plain Old Java Objects that follow certain naming conventions. JavaBean Example Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.11.2006, 00:23:21 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=685&tid=2147610]: |
0ms |
get settings: |
10ms |
get forum list: |
19ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
78ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
34ms |
get tp. blocked users: |
1ms |
| others: | 236ms |
| total: | 398ms |

| 0 / 0 |
