i want to know whether it's a good practice to use a new bean file for each process or i can add a function in the existing bean. For example i put all my setters and getters and functions of login and logout in a single bean instead of two?And i call it from separate servlet file? Which one is a good practice?
Never try to be a hard-worker. Be a smart-worker.
To obtain the less overhead in maintenance, it is always better to segregate/group the related functionality.
Calling it from the Servlet does not really matter but if you do with the database calls for login/logout activities, do have the DAO pattern involved. DAO stands for Data Access Object and it is one of the suggested Design Patterns.
But what would it really happens when i simply code it using a MVC pattern without DAO and i need as many models as if my functionality extends..ie..if my site has 40 kind of functions like login..user details..vendor info...and for each one of them i write a bean file? Will it be a good practice? Could you clarify me!!!
If you write a bean for each functionality your classes will be highly cohesive and maintenance of your code will be easy. On the other hand, you will have more classes It is absolutely based on the requirement and your design choice