• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use OOP and design concepts  RSS feed

 
siddharth paul
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope I am posting in correct place. I am facing an issue with my project design and below code is replica of that. Issue is I have a collection<ParentReference> of objects(with parent and subclasses) now in my implementing class I want to call methods which takes exact object type as parameters. I know instanceof and type cast will give solution but I think typecasting parent to child class breaches OOP concept. If any design changes/design pattern I can do it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!