Android Developers documentation:
Known
direct subclasses: ...
TextView...
but if you click on
TextView:
Shouldn't it be shown like:
Java.lang.Object
... Object.View
...View.TextView
Anyway, I'm thinking if it suits me and how to implement such a thing without having inheritance, i.e. using objects.
For example:
clsMan
... clsWorker
... ... clsEmployee
... ... ... clsManager
Will it be useful (and difficult) to use objects instead of classes? Will using objects involve duplicating many methods?
P.S. ["Playing around"]
Um... to create a new Manager I have to create before all its "parent objects"!
First a Man, then a Worker, then an Employee and only after this long list of actions I can create a Manager!
Dim Man As clsMan
Dim Worker As clsWorker
Dim Employee As clsEmployee
Dim Manager As clsManager
Man.Initialize("Erel")
Worker.Initialize(Man)
Employee.Initialize(Worker)
Manager.Initialize(Employee)
Log(Manager.Name)
And to get (log) the name of the Manager? clsManager could have a property:
Public Sub getName As String
Return mEmployee.Name
End Sub
but this would imply having to have a similar property in clsEmployee:
Public Sub getName As String
Return mWorker.Name
End Sub
and so on. Or clsManager should have an instance of all its parent objects, objEmployee, objWorker, objMan.
What a headache ?
EDIT: no, this is "enough", in clsManager, to get its name:
Public Sub getName As String
Return mEmployee.Worker.Man.Name
End Sub
[Attached a test but B4J, sorry]