During a recent workshop (see
workshop report), the ADP Core Team has the defined a first and very feasibly vision on use of DSL's in the Accelerated Delivery Platform. We are now on the verge of defining a DSL that allows analysts, designers, developers and testers to model smart use cases and the domain model textually. We are developing a small (free) IDE to support this modeling in text.
Using textual DSL's lowers the threshold for modeling software enormously, as users are guided by intellisense. Also, applying this strategy, modeling software does not require the use of (often expensive) modeling tools. Our DSL IDE will support defining our smart use case stereotypes, as well as our domain modeling concepts.
Next steps
We have defined a simple scenario for our next steps:
- Provide a second import mechanism to Tobago, based on the XSD of Tobago’s meta model (Erwin).
- Write a first cut ADF DSL for smart use cases and domain model (Sander, see below).
- Create a IDE for writing ADF DSL (Ron).
- Write an export for the ADF DSL to match the Tobago XSD.
- Do projects.
Smart use case DSL
So here’s our First cut ADF DSL. Feedback is more than welcome, donations too:
Actor Manager;
Actor AccountManager;
Manage ManageCustomer
{
Actors Manager, AccountManager;
Complexity Average;
Manages Customer;
Selects using FindCustomer;
}
Search FindCustomer
{
Complexity Hard;
Selects a Customer;
}
MasterDetail ManageCustomerContacts
{
Actors AccountManager;
Complexity Hard;
Selects a Customer;
Lists Contact;
Handles Optional ManageContact;
}
Manage ManageContact;
{
Complexity Average;
Manages Contact;
}
DomainObject Customer
{
FirstName string;
Phone Optional PhoneNumber;
Email Email;
Type CustomerType;
State States;
Country Country;
}
DomainObject Contact
{
Name string;
Phone Optional PhoneNumber;
}
ValueObject PhoneNumber
{
MayBeEmpty;
Validates ^.*$;
}
ValueObject Email
{
Validates ^[^@]+{2,}@.+{3,}\..+{2, 5}$;
}
Enumeration CustomerType
{
MayBeEmpty;
DefaultValue is Regular;
Values are Regular, VIP, Blacklist, Oneline;
}
SmartReference States;
DomainObject Country
{
Name string;
ISO Optional string;
}
Extensibility
Additionally we need to be able to extend the model and enrich its language with new model elements. For instance:
- Adding new language constructs. We discover a new stereotype, and need to be able to model that too. This new stereotype now needs to become an language construct in our smart use case DSL, preferably without having to modify and rebuild the IDE.
- Call on other language constructs. One type of model element call on another type of model element. This can be the case when a smart use case makes use of domain objects, such as with the
Manage type. In this case, this should not be a problem, because any domain object can be referenced by the use case. - Call on limited collection of language constructs. However, there's a bit more to it. For instance, a
Manage use case uses another use cases to select a domain object. This particular use case however, can not be any type of use case, but should be a domain-object-selecting use case. Thus we need to be able to group types of model elements.
There's different solution the language can offer to elaborate on this. The easiest solution from a modeling perspective is to add a group element to the smart use case specification, such as in the following example.
Manage ManageCustomer
{
Actors Manager, AccountManager;
Complexity Average;
Manages Customer;
Selects using FindCustomer;
}
Search FindCustomer
{
Complexity Hard;
Groups Selections;
Selects a Customer;
}
Including the
Groups property now should allow us to limit the types of use cases than can be used in the
Selects using property of
ManageCustomer to use cases that fall in the
Selections group.
A second option would be to allow inheritance, or an inheritance-like structure. This allows for different layers in the definition of the language, as examplified in the language definition below.
UseCase
{
Actors Actor;
Complexity PieceOfCake, Easy, Average, Hard, ExtremeAndUnknown;
}
SelectionUseCase is a UseCase
{
}
Select is a SelectionUseCase
{
Complexity Easy;
Selects a DomainObject;
}
Search is a SelectionUseCase
{
Complexity Average;
Selects a DomainObject;
}
Manage is a MaintenanceUseCase
{
Complexity Average;
Selects using a SelectionUseCase
Manages DomainObject;
}