Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL for defining attribute facet
icon5.gif  OCL for defining attribute facet [message #1392507] Wed, 02 July 2014 12:46 Go to next message
Thibaut Hellin is currently offline Thibaut HellinFriend
Messages: 1
Registered: July 2014
Junior Member
Good afternoon,

I would like to know if it is possible to define the facets (Length, MaxLength,...) of an attribute through an OCL?

For example, I'm creating a class representing the address (classname: Address). This class has differents attributes that are:
- StreetName
- HouseNumber
- City
- ...

I want to be able to define that (for example) StreetName MaxLength is 60 characters and City MaxLength is 40 characters.

My OCL should start from something like:

self: Address.StreetName. ??? (what should come here?)
self: Address.City. ???

Thanks in advance for your answer
Have a nice day

Thibaut
Re: OCL for defining attribute facet [message #1392650 is a reply to message #1392507] Wed, 02 July 2014 16:48 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7658
Registered: July 2009
Senior Member
HI

Yes, that used to my first test example. See the OCLinEcore Tutorial in
the built in documentation, where you'll find a simple invariant that
enforces lowercase.

Regards

Ed Willink



On 02/07/2014 15:04, Thibaut Hellin wrote:
> Good afternoon,
>
> I would like to know if it is possible to define the facets (Length,
> MaxLength,...) of an attribute through an OCL?
>
> For example, I'm creating a class representing the address (classname:
> Address). This class has differents attributes that are:
> - StreetName
> - HouseNumber
> - City
> - ...
>
> I want to be able to define that (for example) StreetName MaxLength is
> 60 characters and City MaxLength is 40 characters.
>
> My OCL should start from something like:
> self: Address.StreetName. ??? (what should come here?)
> self: Address.City. ???
>
> Thanks in advance for your answer
> Have a nice day
>
> Thibaut
Previous Topic:Extending the OCL Standard Library (and using that in the CompleteOCL editor)
Next Topic:[Parsing Pivot] No viable alternative at input
Goto Forum:
  


Current Time: Thu May 09 10:56:22 GMT 2024

Powered by FUDForum. Page generated in 0.03816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top