-
Notifications
You must be signed in to change notification settings - Fork 42
ST6RI-683 Provide a better programmatic interface #687
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
base: master
Are you sure you want to change the base?
Conversation
- moved library loading from SysMLInteractive to SysMLAccess - changed how extensions are filtered in SysMLUtil - added test for new SysMLAccess API
I noticed SysMLAccess.build() and SysMLInteractive.createInstance() overlaps in many ways. Can we make createInstance() use build()? Also don't we need to call So, for extension purpose, I think we change build() and createInstance() by using generics. For example,
I can propose a commit to use this mechanism. So SysMLInteractive().createInstance() can call build(setup, SysMLInteractive.class) to create a SysMLInteractive instance. |
Also we can put |
@himi As for the builder. I'm not entierly sure whether we even want it or not. My intention was to have some really easy way of setting most things up:
You only need these if you want to work with XMI (.kermlx, .sysmlx) and/or use the REST API. |
I see your point. However, it's really already quite complicated and duplicated in the current initialization. I believe now is the best timing to clean them up (I'm pretty sure we will not do it in the future). At least, SysMLInteractive.createInstance() should use Builder.build(). In addition, we want to extend SysMLInteractive with our own Setup. I hope SysMLAccess/SysMLInteractive flexibly allows such kind of extension use case, and I believe, SysMLInteractive is exactly a good extension case for SysMLAccess. |
Where to call the doSetup is quite an interesting question, for two reasons:
|
@ujhelyiz |
This PR introduces a new programmatic API that provides an easy setup for the language infrastructure (inlcuding reading the standard library) and interfaces for model reading/processing.
Example usages
with REST access
Changes
Added
SysMLAccess
: main interface to interract with the language infrastructureSysMLAPIAccess
: simplified interfaces for publish/loadSysMLParseResult
: wrapper class for parsing/validation issuesSysMLAccess.Builder
: builder for SysMLAccess instaces (mainly for future extendability and configuration)SysMLAccessTest
: test cases for the new APIModified
SysMLUtil
SysMLInteractiveUtil
(these are mostly for printing parts of the model in a human readable format)SysMLInteractive
SysMLAccess
. It's interfaces remain the same but there are some implementation changes (e.g moving functionality up toSysMLAccess
)Removed
SysMLUtil
)