I’m new to Spring programming and I often see examples/tutorials/guides which uses DAO implemention classes. I’ve also seen examples that has “service” classes (and corresponding implemention class) that seems to do nothing but call the main DAO class.
Are these best practice? seems a runabout way of doing things when I can just call the DAO straight? and I’m still adhering to MVC programming without these extra classes.
Thanks for your input. 🙂
Its a good practice to write a service and DAO implementation separately.You can write your business logic in service class and calls to the Database in the DAO implementation class .If any business logic changes needed you change in services and DAO can be used only for the databases operations.