Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibillity of Oriented Object Programming in SARL #34

Closed
gbasso opened this issue Mar 21, 2014 · 6 comments
Closed

Possibillity of Oriented Object Programming in SARL #34

gbasso opened this issue Mar 21, 2014 · 6 comments
Assignees
Milestone

Comments

@gbasso
Copy link

gbasso commented Mar 21, 2014

This is just for convenience.
As JAVA and SARL languages are quite similar, it is difficult to switch between the two languages during development.

@gallandarakhneorg
Copy link
Member

Do you suggest to add a syntax for object oriented language in SARL file?

@gbasso
Copy link
Author

gbasso commented Apr 8, 2014

Yes, as we need to mix oriented object and agent programming in SARL it could be interesting to offer the possibility to create an object in sarl.

@gallandarakhneorg
Copy link
Member

I think a good approach will be to import the Xtend grammar and adapt it to your specific syntax (variable definition...). Currently, it is mostly in this way by extending the Xbase, which is providing the support for expressions.

The question is: do we want to depend on Xtend?

@srodriguez
Copy link
Member

I am not sure that we should have a mixed OOP and AOP in SARL files. I rather have Xtend files for OOP and SARL for AOP. I use Xtend since its syntax is closer to SARL.
This enables programmers to use any OO programming language they want for OOP as long as it is compatible with java (Xtend, Scala, groovy, etc)

What do you think?

@gallandarakhneorg gallandarakhneorg removed their assignment Nov 27, 2014
@gallandarakhneorg
Copy link
Member

I think we could provide the ability to the SARL developers to define OO data structures inside the context of the SARL agent. It is similar to the definition of inner classes in this context.

A typical example is the definition of the states of an agent in an enumeration type. It is not friendly to define the enumeration outside the agent in Java (or any other language). Since the states of the agents are only related to the agent, they should be accessible by other classes or agents. The inner definition in the agent may provide a solution to this small problem.

@gallandarakhneorg
Copy link
Member

Additionally,supporting some OO statements (I'm not sure we should support all the OO syntax; we should decide) has a couple of advantages:

  • Make easier and faster to code in SARL (all in one file).
  • The developer could only know SARL; no need for mastering another language.
  • By including some OO features, we could benefits from the tools provided by Xtend (validator, etc.) that may provide partial answers to the SARL issues related to inheritance.

A recent example of integration of OOP and AOP is Scala and its actor extension.

gallandarakhneorg added a commit that referenced this issue Feb 24, 2015
see #34

Signed-off-by: Stéphane Galland <galland@arakhne.org>
gallandarakhneorg added a commit that referenced this issue Feb 25, 2015
see #34

Signed-off-by: Stéphane Galland <galland@arakhne.org>
gallandarakhneorg added a commit that referenced this issue Feb 26, 2015
see #34

Signed-off-by: Stéphane Galland <galland@arakhne.org>
gallandarakhneorg added a commit that referenced this issue Feb 26, 2015
see #34

Signed-off-by: Stéphane Galland <galland@arakhne.org>
gallandarakhneorg added a commit that referenced this issue Mar 13, 2015
see #34

Signed-off-by: Stéphane Galland <galland@arakhne.org>
gallandarakhneorg added a commit that referenced this issue Mar 13, 2015
see #34

Signed-off-by: Stéphane Galland <galland@arakhne.org>
@gallandarakhneorg gallandarakhneorg added this to the 1.0.0 milestone Mar 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants