Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 19908, Pattern AssociationAccess

by Granville Miller Email: ggmiller@mindspring.com


The pattern AssocAcces generates access-methods for associations. Like get- and set-methods for attributes, each association should only be accessed via special methods.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Together, Version 6.0  to 6.0 215 downloads
Copyright: Open Source or other


Size: 19,296 bytes
Updated on Wed, 07 May 2003 08:18:43 GMT
Originally uploaded on Wed, 07 May 2003 08:18:50 GMT
SHA1 Hash: 3A93CC39CF13C4B743F9C693C6802A9647C579D8
MD5 Hash: 3BE5C223E3FF1385683CD5DAA085FAA2

    Explore the files in this upload

Description
Pattern AssociationAccess
=========================
Jan Peter Riegel

The pattern AssocAcces generates access-methods for associations.
Like get- and set-methods for attributes, each association should only
be accessed via special methods. Especially bidirectional associations
can be kept synchronized using access methdods. This pattern generates the
following methods based on a given association:

get - returns all via connected objects.
con - connects a target object to this association using via .
For bidirectional associations also the reverse connection is made.
dco - disconnects an object from this association using .
For bidirectional associations also the reverse connection is removed.
clear - disconnects all object from this association using . For
bidirectional associations also the reverse connections are removed.

For bidirectional associations two additional methods (conIntern and dcoIntern)
are generated.

The code-generation is driven by a separate property file (AssocAccess.properties).
Changes can be made in this file to adapt the generated methods.

This is my first attempt to write a pattern for togehter. The code isn't too pretty and there
are still some features missing, but I think it is quite usable as it is. Please contact
me if you find bugs or if you have have any improvements (riegel@informatik.uni-kl.de).


Version History
===============
Version 1.0
9.12.2002 Initial Version. Should be funktioning, but still some to-do's are open.


To do
=====
- make deletion of generated methods more sophisticated.
- support for aggregation and strong aggregation
- generate or extend finalize method with dco... statements.
- check methods for cardinality checks.
- use Interfaces for attributes (eg. List link = new LinkedList();)
- extend to other languages (should be easy due to the properties file)
- better documentation


Installation Instructions
=========================

Just compile the source file and copy everything in to a directory
/modules/com/togethersoft/modules/patterns/Java/LINK/AssocAccess.
Don't forget to include the openapi.ja in the classpath.
The Pattern is invoked by selecting an association, and chossing to apply
a pattern to thas association (ctrl-R).

javac -classpath /lib/openapi Pattern.java
mkdir /modules/com/togethersoft/modules/patterns/Java/LINK/AssocAccess
cp *.class Description.html AssocAccess.properties /modules/com/togethersoft/modules/patterns/Java/LINK/AssocAccess


Copyright Notice
================
Copyright 2002 by Jan Peter Riegel

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Server Response from: ETNACDC03