Generating pass-through code when “preferring composition over inheritance”
问题 Problem Let's say I'm trying to model a cell phone as a combination of a regular phone and a PDA. It's sort of a multiple inheritance scenario (a cell phone is a phone, and it is a PDA). Since C# doesn't support multiple inheritance, this pretty much calls for some kind composition. Plus, let's say that I have other reasons to favor composition anyway. The thing I always wonder: Are there any tools that will generate all the inevitable pass-through code automatically? Let me flesh out my