Skip to content

Wollok v1.2 Buddha

javierfernandes edited this page Oct 14, 2015 · 31 revisions

Language

Named Objects can now inherit from classes

Now first class objects (named objects) can inherit from a class. This allows to create well-known objects that share behaviour with other objects but overrides just part of its behaviour. Like a mix between the two words (objects and classes) for modelling special cases.

screen shot 2015-09-16 at 15 47 53

Tests

Wollok now has the concept of test cases as one of the major elements in the language. A test is just like an executable function which contains asserts statements. A test file can have as many tests cases as it wants. And it can also define local objects accesible for the tests cases.

There is also a UI support for tests to show the execution report and the famous green/red bar

screen shot 2015-09-17 at 20 17 11

New Checks

Check Overriding method return compliance

There's a new static check for validating that an method which overrides another one, has a compatible semantic in terms of returning a value. This means that, if the original method was returning a value, the overriding one MUST also return a value. And the opposite.

wollok-checkoverridereturn

Getter method should return a value

Getters should return a value. Sometimes we just forget the "return" statement. This will check it

screen shot 2015-09-18 at 21 38 35

Quick Fixes

We have added a couple of useful quick fixes for some of our static code checks. Here is the list with screenshots.

Remove unused variables

screen shot 2015-10-08 at 18 32 23

Add constructors from superclass

screen shot 2015-10-08 at 23 06 20

Remove duplicated constructor

screen shot 2015-10-08 at 23 22 23

Add call to super

screen shot 2015-10-08 at 23 53 07

Remove override keyword

From native methods that cannot override

screen shot 2015-10-09 at 09 30 07

Replace if with condition

For bad if usage

screen shot 2015-10-09 at 10 58 13

Create constructor in superclass

screen shot 2015-10-09 at 11 41 36

For methods marked as overriding but not overriding anything

There are two options:

screen shot 2015-10-09 at 12 38 26

Remove duplicated methods

screen shot 2015-10-09 at 13 59 56

Initialize non assigned var/val

screen shot 2015-10-09 at 14 19 33

Refactorings

Extract Method

We have implemented our first refactoring: the "extract method", which extracts a given selected piece of code into a new method on the current class/ object

screen shot 2015-10-08 at 12 33 50

This is the wizard

screen shot 2015-10-08 at 12 34 08

And it has a preview of the changes

screen shot 2015-10-08 at 12 35 00

UI

Improvements to Debugger Object's Diagram

The "object diagram" view for debugging has been improved a little bit.

  • It now remembers the nodes positions between steps, so they are not being moved everywhere around the screen :)
  • It now shows the names of the references as labels on top of the connections.
  • It also uses a different color and size (smaller) for numbers values to make it easier to differentiate simple values from more complex user objects.
screen shot 2015-09-17 at 23 22 58
  • Also the List objects are differentiated by using a small rectangle with a different color, instead of a circle
  • References from the list to its elements are also differentiated with a dashed line (instead of solid)
screen shot 2015-09-17 at 23 44 00

Improvements to Class Diagram

A number of improvements have been made to the class diagram

screen shot 2015-09-21 at 20 27 16
  • Inheritance arrows now being shown as empty triangles
  • Selection synchronisation between outline view and the diagram (plus the editor)
  • Methods in class boxes show full parameters signature and icons. Something similar for instance variables.
  • Also methods and instance variables are differentiated visually by two separated boxes within the class node.
  • Double-click on a class node will put the editor focus on that class.
  • Classbox size is now automatically adjusted to fit for all of its content (methods and variables). So that all the content is visible.
  • Methods which returns a value are being marked with a right arrow both in the outline view as well as the class diagram.
screen shot 2015-09-21 at 20 45 38
  • Inheritance connections are now horizontally and vertically only and they follow a single path to the superclass, which makes it appear like a single arrow from several originating subclasses. Like a regular UML arrow.
  • Also the automatic layout now arranges the hierarchy from the TOP to the BOTTOM, down the hierarchy
screen shot 2015-09-24 at 18 49 06
  • Now the diagram also shows named objects (root objects) along with classes
screen shot 2015-09-30 at 10 59 54

Debugger Connection timeout as a preference

When you launch a debug instance it actually executes the program in a separated process to be in control of it. The eclipse debugger UI then connects to that remote process. So the whole debugging session requires a remote communication between the IDE and the running wollok instance. So there's a handshake there. Sometimes the wollok program takes too much time to start listening for connections and you'll see a timeout in the UI. Previously we had a fixed wait time then in the UI. This is now configurable in Wollok preferences. So that slow machines can increase this value to be able to debug.

screen shot 2015-09-16 at 20 11 40

Milestone

Clone this wiki locally