Bad practice to have two classes of the same name in different packages?

前端 未结 5 1552
Happy的楠姐
Happy的楠姐 2021-01-17 13:41

We have split our application so that package A handles data from one external source and package B from another. In both cases we need to create a domain object and have a

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 14:13

    You have to decide if this is more helpful or more confusing. You can get the same problem with using similar names in the same package where the difference is not clear.

    An example of more-confusing-than-helpful is something like

    com.sun.corba.se.internal.Interceptors.PIORB extends
    com.sun.corba.se.internal.POA.POAORB which extends
    com.sun.corba.se.internal.iiop.ORB which extends    
    com.sun.corba.se.impl.orb.ORBImpl which extends
    com.sun.corba.se.spi.orb.ORB which extends    
    com.sun.corba.se.org.omg.CORBA.ORB which extends
    org.omg.CORBA_2_3.ORB which extends
    org.omg.CORBA.ORB
    

提交回复
热议问题