Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize attributes and reflect values in the model #19

Open
tongbong opened this issue Jun 2, 2014 · 2 comments
Open

Initialize attributes and reflect values in the model #19

tongbong opened this issue Jun 2, 2014 · 2 comments

Comments

@tongbong
Copy link
Contributor

tongbong commented Jun 2, 2014

si un aspect est délcaré comme ceci:

@Aspect(className=System)
class SystemAspect {
    public LinkedListMultimap sharedMemory = LinkedListMultimap.create
}

L'affectation ne passe pas par la méthode
SystemAspect.sharedMemory(System, LinkedListMultimap) mais est faite
dans

@SuppressWarnings("all")
public class SystemAspectSystemAspectProperties {
  public LinkedListMultimap sharedMemory = LinkedListMultimap.create
}

Du coup ces attributes ne sont pas initialisés dans le modèle.
Je m'en suis sorti en faisant l'affectation dans le getSharedMemory et
la méthode initialize pour la fifo.
Les méthodes statiques devraient être utilisées non?

@barais
Copy link
Contributor

barais commented Jun 2, 2014

pourquoi tu ne mets pas explicitement un setter dans ton aspect

@tongbong
Copy link
Contributor Author

tongbong commented Jun 2, 2014

C'est ce que j'ai fait pour le sharedMemmory:

@Aspect(className=NamedElement)
abstract class NamedElementAspect {
    def public LinkedListMultimap sharedMemory() {
        val system = _self.eResource.contents.head as org.gemoc.sigpml.System
        if (system.sharedMemory == null)
            system.sharedMemory = LinkedListMultimap.create
        return system.sharedMemory
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants