How to separate interface from implementation in Grails services?

前端 未结 4 1875
鱼传尺愫
鱼传尺愫 2021-02-04 05:15

I was wondering if it\'s possible to create a service interface on Grails and I can\'t find a proper way of doing it. This explanation isn\'t satisfactory, since it seems to mix

4条回答
  •  北海茫月
    2021-02-04 06:01

    • Define the service interface in a class com.mycompany.mypackage.MyInterface.groovy stored under src/groovy
    • Define the service implementation stored under grails-app/services

      class MyService implements MyInterface {
          // service implementation goes here
      }
      

提交回复
热议问题