Skip to content

对于Router类里面,services字段的建议 #102

Open

Description

@mengxin1995
private HashMap<String, Object> services = new HashMap<>();

这个services能不能存一个 名字加一个class对象,在宿主那边调用的时候直接通过这样的方式获得对象
比如

<xxxx, ReadObject.class>
try {
    Object o = Class.forName(aClass.getName()).newInstance();
} catch (ClassNotFoundException e) {
    e.printStackTrace();
} catch (IllegalAccessException e) {
    e.printStackTrace();
} catch (InstantiationException e) {
    e.printStackTrace();
}

这个object再强转成接口对象
这样主要想解决不用花那么大的内存去存储提供服务的对象

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions