| ★ wanayoo — archive 1999 http://www.webtools.com/story/java/TLS19990421S0001 | Nouvelle recherche | Portail wanayoo |
![]() |
![]() |
Free E-mail
|
![]() |
|
||||||||||||||
![]() ![]() |
||||||||||||||
|
By Piroz Mohseni, WebTools (04/21/99) It is doubtful that the creators of JavaBeans expected one day to see a "sex" Bean, but that is exactly what South Shore Machine Tools has come up with. SexMachineBean is a JavaBean that examines a database table where one of the fields is the first name of individuals. It will then determine what gender the name belongs to and come up with an appropriate salutation (i.e., Mr. or Ms.). Although reusability is a major theme with component models such as JavaBeans, another important aspect is components ought to be designed to perform specific functions and do them well. The JavaBean specification provides a framework for creating specific functional units called Beans that can interact with each other to create larger and more complex applications. There is nothing in the specification to prevent one from creating a very complex Bean that does many things, but such Beans break the spirit of component-based software development, and usually, they don't tie in very well to other Beans.
Focused On One Task
jar --xvf smbdemo.jar
Note that jar is a utility program that ships with the JDK On the Windows NT platform, you can use a simple Access database to store your table. Access even comes with a sample "address book" database you can use. The output of SexMachineBean is a replicate of its input table with an additional field containing the salutation. You therefore must have write access to the database so this output table can be created.
[Configure Access First>>>]
Page 1 of 3 |
|
|||||||||||||
| ||||||||||||||
| |||||
![]() |
|