Created
January 18, 2021 09:03
-
-
Save fishyer/c2d46917ccedf3fc7dcc3817216cc2dc to your computer and use it in GitHub Desktop.
依赖注入-服务管理类-使用示例|-|{"files":{"ServiceFactoryManager.java":{"env":"plain"}},"tag":"Android"}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.daigou.sg.app; | |
import com.daigou.sg.manager.LanguageServiceImpl; | |
import com.ezbuy.core.error.ErrorConsumer; | |
import com.ezbuy.core.helper.ServiceFactory; | |
import com.ezbuy.core.language.LanguageService; | |
import com.ezbuy.dto.impl.CartPublicServiceImpl; | |
import com.ezbuy.dto.service.CartPublicService; | |
/** | |
* 初始化ServiceFactory,动态注册所有Service | |
*/ | |
public class ServiceFactoryManager { | |
public static void init() { | |
ServiceFactory.registerService(CartPublicService.class, CartPublicServiceImpl.class); | |
ServiceFactory.registerService(ErrorConsumer.class, ErrorConsumerImpl.class); | |
ServiceFactory.registerService(LanguageService.class, LanguageServiceImpl.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment