Your friend is being very colorful and creative.
However, the code below is not legal. It doesn't make much sense either.
Classes inherit interfaces.
By creating an interface that declares a class in it, what intent is the
programmer attempting to describe in the code? Is it the intent that the
object which implement the interface must "have a" member class completely
declared within them? Why not just define that a child class returns an
object of a particular type from a member method? The same structural
purpose would be served.
In this case, the Interface can simply refer to another interface for a
member method.
This allows you to have composition without the byzantine declaration syntax
below.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"HAM" <hmdzxx5x@hotmaildotcom> wrote in message
news:e3*************@TK2MSFTNGP14.phx.gbl...
One of my friends asked if the followings have any meanings?
'-------------
Public Interface IRenderable
Sub Render()
MustInherit Class Engine
MustOverride Sub TurnOn()
Interface IAutomatic
Sub Start()
End Interface
End Class
End Interface
Public Class RenderMan
Inherits IRenderable.Engine
Implements IRenderable, IRenderable.Engine.IAutomatic
Public Sub Render() Implements IRenderable.Render
'Code for implementation
End Sub
Public Sub Start() Implements IRenderable.Engine.IAutomatic.Start
'Code for implementation
End Sub
Public Overrides Sub TurnOn()
'Code for implementation
End Sub
End Class
'-------------
Does this all comply with the specification of OOP? Just curious...