Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In the code you have submitted above, there's no evidence of circular dependency.</p> <p>When your call travels from upper layers to bottom layers... your object transformed into specialization which is appropriate to each layer (However in your case you are dealing with primitives on each layer... atleast in the submitted code)... And when your call returns it should be from specialization towards generalization....</p> <p>This could be vice versa and there is no circular dependency issues if a single path is observed in such a way. However if with in any layered you try to implement Specilization scenario for both side information traveling path then we've a problem since each layer will depend and required the reference of its enclosing layer.</p> <p>But in your code there's no such evidence of circular dependency. However if there's such a case this can be avoided by implementing interface layer or Adapter Pattern (interface layer is an adapter pattern).</p> <p>For instance we have a Layer InformationTravel (IT)...(OK I understand this not sounds too good)</p> <p>| UI | | | InformationTravel | ** | | Business Object | | | OR-Mapper | | | Data Access | | | RDBMS |</p> <p>What you do is for your User Business Object, declare an interface IUser and implement it in User business object....</p> <p>Then BO have a reference of IT. Object creation should only be in BO layer which implements an interface from IT.. This is perfectly OK. When you need to pass this object to your ORM, you pass it by slicing it to an interface implemented in IT and when you receive it back you again return the same object after doing necessary modification.</p> <p>But this again impose an implication that you can't create your BO at multiple layers since only BO have the implementation of the interface. However if you really can't avoid this then you have to provide the implementation at multiple location or use Adapter pattern (Encapsulate your object into another object which is expected by the client).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload