It is currently Wed Feb 08, 2012 11:54 pm



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: GOF Design Pattern Profile
PostPosted: Mon Oct 08, 2007 9:58 am 

Joined: Thu Aug 30, 2007 4:31 pm
Posts: 152
Location: Germany
Attached an example how to implement Design Pattern Support including CodeGeneration via Rhapsody Profiles

Use AddtoModel in Rhapsody in order to add the Profile to your Model.. and your Rhapsody Browser should include the following GOF Pattern (picture):


Attachments:
File comment: GOF Picture
GOF.gif
GOF.gif [ 3.01 KiB | Viewed 967 times ]
File comment: GOF Profile
GOF_Profile.zip [2.09 KiB]
Downloaded 124 times
Offline
 Profile  
 
 Post subject: Re: GOF Design Pattern Profile
PostPosted: Tue Nov 10, 2009 11:43 am 

Joined: Wed May 07, 2008 3:50 pm
Posts: 148
Location: Horsham, W Sussex, England
Mickey,

I thought I'd wait 2 years to reply!

I can see that you use "CG::Class::StandardOperations" but what does that mean exactly?
I guess you added the new properties to your prp file when you generated the stereotype but a user doesn't need that same prp file. Is that true?

What does the word you type in StandardOperations mean/do? It doesn't appear in any generated code does it? You chose the word 'singleton' but I suppose you could equally have called it 'anythingILike'?

I know it all works nicely but my lack of understanding is bothering me!

Another thing -
How can I see what property changes are related to a stereotype from the PredefinedTypes?
For instance, <<Mutex>> - what property changes were made when this stereotype was constructed?

Thanks.


Offline
 Profile  
 
 Post subject: Re: GOF Design Pattern Profile
PostPosted: Tue Nov 10, 2009 8:10 pm 
User avatar

Joined: Thu Sep 13, 2007 7:34 pm
Posts: 397
Location: London
The standard operations are explained very well in Rhapsody help. Just do a search.

Personally I don't like the GoF singleton pattern and, in addition, standard ops don't animate which can cause havoc. Try animating and using the GoF singleton and you'll see what I mean.


Offline
 Profile  
 
 Post subject: Re: GOF Design Pattern Profile
PostPosted: Tue Nov 24, 2009 2:48 pm 

Joined: Wed May 07, 2008 3:50 pm
Posts: 148
Location: Horsham, W Sussex, England
Farquad,

You say standard operations don't animate.
Do you think it would matter for auto-generating private (undefined) copy constructors and copy assignment operators?
Our coding standard says,"
Always define or disable copying for classes with reference semantics.
A class has reference semantics if bitwise copying is not appropriate. For example, classes that own resources such as dynamically allocated memory, file handles, mutexes and so on, should not be bitwise copied.
To define copying behaviour a class must define both a copy constructor and a copy assignment operator.
To disable copying declare both a private and undefined copy constructor and copy assignment operator; or, preferably, inherited privately from boost::noncopyable as this expresses the class’ copy semantics declaratively.
For example:
class Widget : private boost::noncopyable
{

};

or

class Widget
{

private:
Widget(const Widget&); // declared but not defined
Widget& operator= (const Widget&); // declared but not defined
};

Alexandrescu & Sutter Item 52 & 53
Myers Item 14
"


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

cron

suspicion-preferred