-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AY18/19 Q2 Cyclical Dependency #604
Comments
Following the Dependency inversion principle, declare an interface between both classes to break the dependency and invert the dependence from one? So maybe console class implements the new interface while logic's argument is the interface. Hope it helps!! a little hard to explain >.< |
@zannlimjm OH! okay i get the gist of it will work on coding it out. Thanks alot1!! |
Hi there, I have tried it out after @zannlimjm mentioned the implementation. Can anyone help to see if this is correct? Thank you!
`class Console implements Logic {
}`
|
Source
Description
Helloo, was doing this question and am stumped. I understand that the console start method relies heavily on logic and Logics invokes method also requires knowledge of the Consoles methods. How would you guys approach removing the cyclical dependency for this?
Screenshots (if any):
Insert Images here if necessary
The text was updated successfully, but these errors were encountered: