zoukankan      html  css  js  c++  java
  • 接口的方法能不能少一点?简单点?

    某个接口的设计

    FileConnector 

    public void saveFile(String uploadPath, File[] files)
       throws FileNotFoundException;

    为什么是File[]?很奇怪,考虑复杂业务是不是太多了?实现类受得了这么折腾吗?

     //XXX: 能否就指定文件的path?
     public void saveFile(String uploadPath, String fileName,
       InputStream inputStream) throws FileNotFoundException;

    最后改成:

     <T> T read(InputStreamReader<T> reader) throws IOException;

     void write(OutputStreamWriter writer) throws IOException;

  • 相关阅读:
    Vue入门
    吃透SprinngBoot
    SSM整合详解
    Linux查找端口并关闭
    接入腾讯云的OCR识别身份证信息
    IDEA 快捷键《宋红康版》
    Mysql详解
    docker常见命令
    SpringBoot集成Redis
    使用mybatis出现异常
  • 原文地址:https://www.cnblogs.com/bluejoe/p/5116024.html
Copyright © 2011-2022 走看看