For study purposes only

lebasxsp

New Member
Can anyone help me with this ? Does B4A support all of these qualities : Encapsulation/Information Hiding ?
Inheritance ?
Polymorphism/Dynamic Binding ?
All pre-defined types are Objects ?
All operations performed by sending messages to Objects ?
All user-defined types are Objects ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Encapsulation/Information Hiding ?
Yes (https://www.b4x.com/android/forum/threads/18628/#content)

Polymorphism/Dynamic Binding ?
B4X supports duck typing through the usage of CallSub (https://www.b4x.com/android/forum/threads/classes-tutorial.18626/#content)

All pre-defined types are Objects ?
It is the same type system as Java. The numeric variables (primitives) are not objects. All other types are objects.

All operations performed by sending messages to Objects ?
See the previous answer.

All user-defined types are Objects ?
More or less yes. There are three types of user types:
- Classes
- Custom types created with the Type keyword (similar to classes without methods).
- Static code modules - (similar to singleton classes).
 

lebasxsp

New Member
Yes (https://www.b4x.com/android/forum/threads/18628/#content)


B4X supports duck typing through the usage of CallSub (https://www.b4x.com/android/forum/threads/classes-tutorial.18626/#content)


It is the same type system as Java. The numeric variables (primitives) are not objects. All other types are objects.


See the previous answer.


More or less yes. There are three types of user types:
- Classes
- Custom types created with the Type keyword (similar to classes without methods).
- Static code modules - (similar to singleton classes).

Thanks Erel :) such a big help .
 

lebasxsp

New Member
Did I answer this right ?

Static / Dynamic Typing :


Static

Inheritance :


None

Feature Renaming :


No

Method Overloading :


Yes

Operator Overloading :


No

Higher Order Functions :


No

Lexical Closures :


No

Garbage Collection :


Mark and Sweep or Generational

Uniform Access :

Class Variables / Methods :


Yes

Reflection :


Yes

Access Control :


public, private

Multithreading :


Yes

Regular Expressions :



Pointer Arithmetic :


No

Language Integration :

Built-In Security :
 

Troberg

Well-Known Member
Licensed User
Longtime User
Did I answer this right ?

Static / Dynamic Typing :

Static

I would say that duck typing belongs in the dynamic typing family. You can do static typing (and it's what you mostly do), but you can also do duck typing and simply do a CallSub(UnknownObject, "Quack") without knowing at compile time if it's a duck or a bad doctor you are calling.
 

Cableguy

Expert
Licensed User
Longtime User
but you can also do duck typing and simply do a CallSub(UnknownObject, "Quack") without knowing at compile time if it's a duck or a bad doctor you are calling.

I'll go with the Quacky Duck... Not too fond of (bad) Doctors!
 
Top