Concepts and concept interfaces

What is the use of having concepts and concept interfaces. Couldn't you express everything using just concepts allowing concepts inheriting from multiple concepts?

7 comments
Comment actions Permalink

Hello, Marc,

We've created concepts and concept interfaces since we like the way classes and interfaces are implemented in java. It's possible to express everything with concepts that support multiple inheritance but concept interfaces designate concept that can be traits of another concept.

0
Comment actions Permalink

For each concept you need to decide which type to use a Concept or a Concept Interface. (Currently it is impossible to convert a concept into a concept interface or vice versa).

I have always found the difference between interfaces (in fact completely abstract classes) and classes in java artificial. I have been developing java programs the last 10 years and I know that everything can be expressed using classes and interfaces (or concepts and concept interfaces), but often a whole lot of useless code is needed to support certain features (look at the amount of interfaces needed to effectively use Spring in an application). A language like scala where multiple inheritance is supported using traits or eiffel where no interfaces exist provide much more flexibility to design and create a solution.

Shouldn't concept interfaces be treated as a special type of concept and multiple inheritance be allowed?

0
Comment actions Permalink

They are treated as special kinds of concepts. It's possible to have an instance of a concept interface inside of a model.

0
Comment actions Permalink

Is it possible to create a complete model using only concept interfaces instead of using concepts and concept interfaces?

0
Comment actions Permalink

Hi Marc,

Yes, you can do that.

The only reason why we did choose interface-concept over multiple inheritance is that we support generation of java api from a language structure.

When developing a language you are free to choose either oop approach, providing that you are not going to use the generated api.

0
Comment actions Permalink

Thanks for the quick and clear response.

You really busy working on a great product with fantastic possibilities. The past years I always thought that I lost too much time translating business into something the computer understands. Although java IDE's have improved a lot, I've always felt the urge to find a language, a method to increase productivity. MPS is definitely a superior solution waiting to become a great product.

Keep up the good work.

0
Comment actions Permalink

Great to hear you believe in MPS! :-)

Returning to interfaces... at second sight though, interface-concept has certain limitations : it won't appear in 'New root node' menu and won't show-up in a default auto-completion menu.

Therefore leaf concepts in your hierarchy most likely must be solid concrete concepts.

0

Please sign in to leave a comment.