DAO and dependency injection, advice?

后端 未结 4 999
谎友^
谎友^ 2021-01-13 12:08

This is the first time im using the DAO pattern. From what I\'ve read so far, implementing this pattern will help me seperate my calling code (controller) from any persisten

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 12:48

    Hi i am not an expert in java. but trying to give a solution.

    you can have a superclass where all the connection related stuff happens and any other base class where you can extend and use it.

    Later any switch in your DB for specific 3rd party drivers you can rewrite the superclass.

    Again I am no expert. Just trying around here to learn. :)

提交回复
热议问题