inheritance - Java one child class containing other siblings -


I saw that some code has a child in which there are other siblings, for example, in the below Child1 Brother-Sister Child 2, Child 3 are included. I wonder if there is a problem in this design?

  Public Class Parents {...} Public Ultimate Classroom Child1 Parents Detail (Private Child 2 Children 2; Private Child 3 Children 3; ...} Public Finals Class Child2 Mothers- Expanding the father {...} Public Final Class Child3 Parents Expansion ... Itemprop = "text"> 

There is nothing wrong with the code posted by you technically, but let me The question arises whether this is the right way to model your domain. Does it make sense to talk to children 1 and Child3 from the point of view? Or is this just a way to divide your code into logical classes?

In addition to this, The tree should be avoided where the legacy is probably the strongest form of coupling. Perhaps you can apply the same functionality by using the strategy method to reduce coupling.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -