28th November, 2008 - Posted by rafael.chaves - 2 Comments
Just checked in a new feature in the TextUML Toolkit: support for data types (a.k.a. structs). This is an example of a data type declaration:
datatype UserName
attribute firstName : String;
attribute lastName : String;
end;
You can declare operations and specialize other classifiers as usual.
Change set
Here are the individual changes per plug-in (r177-r186):
There, nice and easy. Well, actually, I ended up doing a second commit because I forgot to ensure a data type specializes only other data types. But now that has been taken care of.
As usual, suggestions of UML features to support in the TextUML Toolkit are most welcome.
Read More
23rd November, 2008 - Posted by rafael.chaves - 3 Comments
Great discussion over @ Slashdot: Is Open Source Software a Race To Zero?
I really think the open source approach has lots of benefits, for the software itself and all parties involved. However, I would say it will probably take a decade before sound business models based on open source are really understood and start to become mainstream.
At this point in time, (as most people) I still think it is considerably harder/trickier to make money developing software as open source than it is with closed source. At least for small companies. A few reasons:
- reduced barrier to entry for new competitors as they can easily leverage the fruits of your hard work. Even more so if you choose a more liberal license such as a BSD, EPL or Apache (JBoss and MySQL use GPL, for instance).
- lower profit margins, if you decide to adopt a services-based business model instead of one based on selling product licenses, which is a common approach.
- the overhead of maintaining the open source software while developing the closed source extensions or providing the related services, the very activities that will actually make money, could be unbearable.
The TextUML Toolkit is open source (EPL) since release 1.1. The decision of making the TextUML Toolkit open source was based on the fact that I (a.k.a. Abstratt Technologies) never intended to make any money directly off of it, wanted to attract external contributions and maybe get some visibility to other future offerings. But I wouldn’t have done it if I had any plans of selling the TextUML Toolkit as a product on its own.
Well, I am interested in your thoughts. Do you know of cases of small companies making good money from developing and selling open source software (using liberal licenses such as the EPL)?
Read More
13th November, 2008 - Posted by rafael.chaves - No Comments
I would like to see the TextUML Toolkit as an Eclipse MDT subproject. Not long ago, I talked to Kenn Hussey and Ed Merks (they lead the UML2 and EMF projects, respectively) about the idea of proposing the Toolkit to the EMO and they both liked it (Ed actually suggested the idea in the first place). However, I was concerned that just one guy (yours truly) working on the project on and off in his spare time with no user community didn’t look very promising, and Kenn promptly agreed, so it was decided that it was important to get other people on board first.
With the intent of starting to gather some sort of community and hopefully contributors, I decided to release version 1.1 as EPL. In the first couple of weeks after that, I noticed a significant spike in interest (page hits, issues opened, forum activity). But then everything went back to how it was before: today, there is no evidence anybody is using the tool, and I am still the only committer in the project.
So, this is a call (or a cry) for contributors: if you like the textual approach to UML modeling proposed by the TextUML Toolkit, would like to help putting together a proposal, and have some amount of time/resources to commit to the project in the long(ish) run, I am really eager to hear from you.
Things that are in scope for the project:
- broader notation coverage of UML features
- richer IDE support: content assist, search/hyperlinking, refactoring
- better integration with graphical UML tools
If you are interested, feel free to contact me via this blog, the Toolkit forum or e-mail (rafael at abstratt.com).
Read More
11th November, 2008 - Posted by rafael.chaves - 1 Comment
Just checked in a new feature in the TextUML Toolkit: required extensions for stereotypes (honestly, I didn’t know about that feature in UML until I read this post on the Eclipse UML2 newsgroup).
The following is a stereotype extending two metaclasses (uml::Class and uml::Operation):
profile my_profile;
import uml;
stereotype foo extends Class, Operation required
end;
end.
In the example above, the extension of Operation is required, the extension of Class is not.
Change set
The change set to implement required extensions in the TextUML Toolkit (issue #2266268) was quite small (btw, kudos to the UML2 project for providing the best API for UML out there).
Here are the individual changes per plug-in (r153-r156):
Any other UML feature you would like to see exposed in the TextUML notation? Suggestions are welcome.
Read More
7th November, 2008 - Posted by rafael.chaves - 1 Comment
The first milestone build of the next TextUML Toolkit release is now available from the milestone update site. This preview build is the first to include support for modeling behavior using action semantics. I hinted at this capability here before, and I plan to cover action semantics in the TextUML notation in following posts. But most people will get the gist of the notation from the examples below:
Here is an example of a UML model of an Account class represented in TextUML:
model bank;
import base;
class Account
attribute accountNumber : String;
attribute balance : Integer;
operation withdraw(amount : Integer);
begin
self.balance := self.balance - amount;
end;
operation deposit(amount : Integer);
begin
self.balance := self.balance + amount;
end;
static operation newAccount(number : String,owner : Client): Account;
begin
var newAccount : Account;
newAccount := new Account;
newAccount.accountNumber := number;
newAccount.balance := 0;
link ClientAccount(owner := owner, accounts := newAccount);
return newAccount;
end;
end;
class Client specializes Object
attribute name : String;
static operation newClient(name : String): Client;
begin
var newClient : Client;
newClient := new Client;
newClient.name := name;
return newClient;
end;
end;
association ClientAccount
navigable role owner : Client[1];
navigable role accounts : Account[0, *];
end;
end.
And here an example of a test driver ‘program’ (note the use of a closure for looping through a collection of objects):
package test;
apply base_profile;
import bank;
import base;
class TestDriver
[entryPoint]
static operation run();
begin
var john : Client, mary : Client,
account1 : Account, account2 : Account, account3 : Account;
john := Client#newClient("John Doe");
mary := Client#newClient("Mary Doe");
Console#writeln("Created: ".concat(john.name));
account1 := Account#newAccount("1234-1", john);
account2 := Account#newAccount("1238-2", mary);
account3 := Account#newAccount("2231-7", john);
Console#writeln("account owner: ".concat(account1->ClientAccount->owner.name));
Console#writeln("account number: ".concat(account1.accountNumber));
Console#writeln("initial balance is: ".concat(account1.balance.toString()));
account1.deposit(2000);
Console#writeln("after deposit, balance is: ".concat(account1.balance.toString()));
account1.withdraw(500);
Console#writeln("after withdrawal, balance is: ".concat(account1.balance.toString()));
/* Now show information for all accounts. */
Account extent.forEach(
(a : Account) {
Console#writeln("*******");
Console#writeln("Owner: ".concat(a->ClientAccount->owner.name));
Console#writeln("Number: ".concat(a.accountNumber));
Console#writeln("Balance: ".concat(a.balance.toString()));
}
);
end;
end;
end.
And here is the output of the test driver program, produced by running it on the Libra UML runtime (not part of the TextUML Toolkit):
Created: John Doe
account owner: John Doe
account number: 1234-1
initial balance is: 0
after deposit, balance is: 2000
after withdrawal, balance is: 1500
*******
Owner: Mary Doe
Number: 1238-2
Balance: 0
*******
Owner: John Doe
Number: 1234-1
Balance: 1500
*******
Owner: John Doe
Number: 2231-7
Balance: 0
Alternatively, one could have generated 100% of the code for a target platform of choice, given that all the information necessary for that is in the model. Note that code generation is not part of the TextUML Toolkit.
Do you want to give it a try? Install M1 from the milestone update site. You can also fetch the example projects from here.
It is certainly a rough stone. I am counting on the community feedback to figure out what areas need to be smoothed first. Please provide your feedback or ask questions on the TextUML Toolkit forums.
Read More
2nd November, 2008 - Posted by rafael.chaves - 6 Comments
Do you know what UML can do for you? I mean, did you know that UML models can actually do things?
One of the least known features of UML is that you can model detailed imperative behavior. The UML “instruction set” can do things like:
- create and destroy objects
- create and destroy links (associations) between objects
- read and write attributes and local variables
- invoke operations and functions
- throw and catch exceptions
- conditional statements
- loops
That is quite amazing, isn’t? And all that while still preserving a high level of abstraction. Such capability is generally referred to as ‘action semantics’. Action semantics provides the basic framework for executability in UML and has been there for quite a while now. It was originally added to the spec, first as patch, in UML 1.5 (2003), and then more seamlessly integrated into UML 2.0 and following spec releases.
Action Semantics and TextUML
An even more well-kept secret is that the TextUML notation supports UML action semantics and thus the creation of fully executable UML models. This support is not yet shipped as part of the TextUML Toolkit, but will be in the next release. Meanwhile, if you want to give it a try or take a closer look, you will have to grab the source from the SVN repository.
I plan to go into more details in the near future, but just to wet your appetite, here is one example of an executable UML model described in the TextUML notation:
package hello;
apply base_profile;
import base;
class HelloWorld
[entryPoint]
static operation hello();
begin
Console#writeln("Hello, World");
end;
end;
end.
Cool, isn’t? If you had a UML runtime, this model could be executed even before you made a decision about what platform to target. Also, if your code generator were action semantics aware, you could trigger code generation for the target platform(s) of choice, with the key difference that you could achieve (or get very close) to full code generation, as the model now also describes behavior. No more of that monkey business of having to edit the generated code and manually fill in all those /* IMPLEMENT ME! */ methods.
Do you think this has value? Would you want to work with a tool that supported that? I am really keen on knowing your opinion.
Read More