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

Port: Is it needed? #7

Open
ghost opened this issue Nov 4, 2017 · 6 comments
Open

Port: Is it needed? #7

ghost opened this issue Nov 4, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 4, 2017

An element can be declared as :

option 1:

context c1
   public media media1
   end
end

option 2:

context c1
   media media1 [public, etc]
   end
end

option 3:

context c1
private:
   media media1
   end
public:
   media media1
   end
end

And then the elements external to c1 have access to the media1.

@ghost
Copy link
Author

ghost commented Nov 4, 2017

This bring a few questions:

  • All the elements external to c1 will have access to media1? Or just the father of c1?
  • How the start of the application will be defined?

@robertogerson
Copy link
Collaborator

robertogerson commented Nov 6, 2017

My suggestion is to use "export" (or maybe "public", or "port" itself) keyword:

context c1
   port media m1
   end
   # or
   export media m1
   end
   # or
   public media m1
   end
end

About the questions, one solution is to use the same behavior of NCL: 1. anyone that has access to the context, will have access to its exported (or "public" or "ported") media objects; and 2. all exported media (or public or ported media) objects will be started when the context is started.

Another issue that we must be aware of is that the original NCL element has two attributes: component and interface. By using one of the above keywords we are supporting the component attribute. How do we support the interface attribute?

@ghost
Copy link
Author

ghost commented Nov 9, 2017

Implemented with commit 8ed1d92

Still needs more tests though

@robertogerson
Copy link
Collaborator

Another possibility that we haven't discussed yet is:

context c1
   ports m1 m2 m3
   media m1 ... end
   media m2 ... end
   media m3 ... end
end

@ghost ghost closed this as completed in d2f03b9 Nov 16, 2017
@ghost ghost reopened this Nov 19, 2017
@ghost
Copy link
Author

ghost commented Nov 19, 2017

Another option:

context c1
   port m1 pC1M2:m2 m3 end
   media m1 ... end
   media m2 ... end
   media m3 ... end
end

This way, the ports of m1 and m3 are generated automatically,while the m2 one is "pC1M2"

@ghost
Copy link
Author

ghost commented Nov 19, 2017

For now, the port is like it used to be

context c1
   port pC1m1 m1 end
   port pC1m2 m2 end
   port pC1m3 m3 end
   media m1 ... end
   media m2 ... end
   media m3 ... end
end

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

No branches or pull requests

1 participant