标题:spring 注入的问题,请大佬解惑
取消只看楼主
zzq673388140
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2018-12-26
结帖率:0
已结贴  问题点数:20 回复次数:0 
spring 注入的问题,请大佬解惑
代码是这样的:
   第一段:public interface UserDao {
                public int addUser(User user);
                public int updateUser(User user);
           }
  第二段:public class User {
          }
  第三段:public class UserDaoImpl implements UserDao {

            public int addUser(User user) {
            System.out.println( "UserDaoImpl.addUser()" );
            return 0;
            }

            public int updateUser(User user) {
                System.out.println( "UserDaoImpl.updateUser()" );
                    return 0;
            }

            }

  第四段:public interface UserService {
             public boolean addUser(User user);
             public boolean updateUser(User user);
 
          }

  第五段:public class UserServiceImpl implements UserService {

                public boolean addUser(User user) {
                    System.out.println( "UserServiceImpl.updateUser()" );
                     return false;
                }

                public boolean updateUser(User user) {
                    System.out.println( "UserServiceImpl.updateUser()" );
                    return false;
                }

            }

问题是怎么看出来UserServiceImpl 依赖了 userDao?
这里面似乎并没有私有属性啊
搜索更多相关主题的帖子: User return out int public 
2019-11-15 17:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-497835-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011325 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved