Using Object Oriented feauters of JS in Servoy

Javascript is an Object Oriented language and Servoy already uses this feature, but I would like to know how (and if) I can define my objects and use them in Servoy.
For example I could create a constructor and a specific prototype, but the visibility of this thing is only inside the method where I “declared” the object?
How can I make my objects visible to the entire solution?
If this is possible, could you post some simple examples?

In a Servoy method you cannot declare an Object or inner function, the current scriptengine does not allow inner declaratons. To use your own objects have a look at the JavaBean support or Servoy Plugin API (which have tobe in Java language)

Do you have a plan for Object Oriented programming in Servoy?
The way is Servoy now is not truly Object Oriented.

There are no plans to change or allow more in scripting as is currently possible, unless someone comes with a reason/senario to change of what we have today.

The main reason is to have all advantages of an Object Oriented system.
JavaScript is already an OO language, so I think is not a big issue to let Sevoy use this feature.
A thing very usefull is also the possibility to subclass interface elements.

I don’t have 1 reason, the reasons are those of all OO languages:

  • reusability
  • code protection
  • bugs minimization
  • fast developement/debugging

Procedural programming is not so bad, but once you discovered OO it seems more difficult to develop complex applications without objects.
As I said in other threads I think Servoy is a very good product:

  • it runs on Mac/Win/Linux
  • it is a true client/server application
  • it used a standard programming language (potentially OO eve if not
    so powerfull as C++,Java etc…)
  • it is simple
  • it is fast

But what I don’t like of Servoy is it is too “end user oriented”.
I’m a developer so I see thing in another perspective.

I hope you can seriously consider my words.
(And I apologize for my english!)

The good news is that you can already do this in Servoy. If you want to go OO simply code in Java and release your business rules as Servoy plugins and anything UI-related as a JavaBean.

We are aware of the benefits of OO, but how whould you like to use that in Servoy?
For example the UI elements are written in Java (or are standard Swing) they are just to complex to be subclassed in JavaScript.
We see JavaScript in Servoy as the perfect (script)language to work with Java Objects in an OO manner.

We are aware of the benefits of OO, but how whould you like to use that in Servoy?

For example to biuld business-objects that is abstract objects working on data: for example I could define an account object and put into it the logic for account management, so I could use the object in many parts of my solution. Another more comlex object could extend Servoy log logic and be involved in data manipulations…
In general could be very usefull to put common code into objects.

For example the UI elements are written in Java (or are standard Swing) they are just to complex to be subclassed in JavaScript

I don’t know Java but it could be enough to expose only methods and properties already exposed in Servoy. In this way for example I could build a textedit field with some logic into it and reuse it in all of my forms without the need of recoding each field.
The idea is to have a personal gallery of UI elements.

Currently we think JavaScript is fine for business logic but we will not advice JavaScript for reusable (business) components.
We take your ideas in consideration for future Servoy versions, in mean time you will have to write Java code for components.