Home » Modeling » TMF (Xtext) » Real business benefits of Xtext(Is Xtext an academic ivory tower)
|
Re: Real business benefits of Xtext [message #1732992 is a reply to message #1732975] |
Mon, 23 May 2016 15:13 |
Ed Merks Messages: 33224 Registered: July 2009 |
Senior Member |
|
|
Tony,
I'm sure others will chime in but here's my two cents worth.
On 23.05.2016 15:59, Tony Chou wrote:
> Please don't be offended by the topic/subject. I am just trying to
> figure this out.
>
> The Xtext framework comes in with loaded features and I'm still
> overwhelmed by the learning curve required to pick up the vast amount
> of information and knowledge needed to drive this thing.
Of course doing all the same thing by hand yourself would take you years.
> I have done some studies on Rational Software Architect and did some
> OCL and was not able to understand ECore at that time.
What can I see. Ecore is really quite a simple thing. And there's more
than enough documentation, even a book.
> Then I started looking into DSL and then ended up at Xtext.
Why are you looking at DSLs? What is the purpose of a DSL for you?
> I am amazed that for an Xtext project it generates so much code and
> projects for me. Now I decided to seek help in this forum.
It certainly wouldn't be much fun or very productive to do that by hand.
>
> So, after going through all the nice Xtext rules definition process,
> what am I supposed to do with my DSL?
That would be up to you to answer. Certainly one fundamental point
would be that the target users should find it convenient to use, i.e.,
more convenient than a graphical editor or a forms-based editor.
>
> Going thru Xtext process, a rule is a rule and it is fun to figure out
> the grammar. But afterwards, it still defines a language that someone
> need to be able to develop.
Indeed.
> Is its purpose so that a business person who is more familiar with the
> domain can quickly define the necessary "objects" used in that domain
> and be able to coordinate them more conveniently?
Yes, of course.
> In some way, this extra layer almost seems a waste of time. Why can't
> I simply define the underlying class using Java directly and use
> reflection to produce the UI?
You could, and if that would make users happier, you should. And if you
like writing code by hand, then everyone is happy.
>
> I am not able to figure out the "saves" if all we want is so that it
> can use ECore to do provide more dynamic modeling capabilities.
> Doesn't Java's reflection API good enough for this?
No, not really. Can you use Java reflection to read and write an XML
serialization of your data? Maybe with enough funky annotations from
some other framework you could. But of course you'd be defining a model
that way too, just in another formalism...
> I am sorry but I just can't understand the connections and advantages
> of using Xtext and really can use some help in guiding me.
It's all a question of what is your domain and who are the end users in
that domain. You've said nothing about that...
> Nowadays you have all kind of frameworks that are supposed to help you
> with your work. For example, you could have your aspect annotation do
> logging or database transaction management, and the Spring frameworks
> API.
>
> Could someone please shed some light?
Xtext is all about defining a clear, concise notation for capturing what
the domain expert needs to express. That information is then generally
used as input to some other processing steps, where the steps depend
completely on the domain involved.
>
> Sincerely,
>
> Xtext 101 Student
>
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Real business benefits of Xtext [message #1732998 is a reply to message #1732975] |
Mon, 23 May 2016 16:01 |
Ed Willink Messages: 7675 Registered: July 2009 |
Senior Member |
|
|
Hi
I presume you want a DSL because you have a domain-specific application,
so in modeling terms you want a DS model that controls/configures that
application. Xtext gives you limited help on the application side of the
model (possibly the generator helps but I've never used it.)
Where Xtext is really powerful is in supporting the
creation/maintainance of your DS model. From an annotated EBNF grammar
(Xtext) you get a DS model, parser, unparser, editor almost for free.
With a little effort you can enhance the ergonomics.
When I had this requirement a month ago I was pleasantly surprised that
I successfully created grammar and editor in less than a couple of
hours. AND I didn't encounter a single tooling bug.
(I have to agree that the generated code size is rather large. For an
editor, the size may be acceptable. If you only want a parser and are
really concerned about code size, I would still recommend Xtext, but
since it is model-based, an Xtext-to-something else may be attractive. I
have an xtext2lpg converter that enables me to diagnose non-LALR-ness of
the grammar - a little more work and it should be a viable parser using
Xtext as specification, but with a 90% code size and perhaps 50% speed
saving.)
Regards
Ed Willink
On 23/05/2016 14:59, Tony Chou wrote:
> Please don't be offended by the topic/subject. I am just trying to
> figure this out.
>
> The Xtext framework comes in with loaded features and I'm still
> overwhelmed by the learning curve required to pick up the vast amount
> of information and knowledge needed to drive this thing. I have done
> some studies on Rational Software Architect and did some OCL and was
> not able to understand ECore at that time. Then I started looking into
> DSL and then ended up at Xtext. I am amazed that for an Xtext project
> it generates so much code and projects for me. Now I decided to seek
> help in this forum.
>
> So, after going through all the nice Xtext rules definition process,
> what am I supposed to do with my DSL?
>
> Going thru Xtext process, a rule is a rule and it is fun to figure out
> the grammar. But afterwards, it still defines a language that someone
> need to be able to develop. Is its purpose so that a business person
> who is more familiar with the domain can quickly define the necessary
> "objects" used in that domain and be able to coordinate them more
> conveniently? In some way, this extra layer almost seems a waste of
> time. Why can't I simply define the underlying class using Java
> directly and use reflection to produce the UI?
>
> I am not able to figure out the "saves" if all we want is so that it
> can use ECore to do provide more dynamic modeling capabilities.
> Doesn't Java's reflection API good enough for this? I am sorry but I
> just can't understand the connections and advantages of using Xtext
> and really can use some help in guiding me.
> Nowadays you have all kind of frameworks that are supposed to help you
> with your work. For example, you could have your aspect annotation do
> logging or database transaction management, and the Spring frameworks
> API.
>
> Could someone please shed some light?
>
> Sincerely,
>
> Xtext 101 Student
>
>
>
>
>
|
|
| | | | |
Re: Real business benefits of Xtext [message #1733183 is a reply to message #1732975] |
Wed, 25 May 2016 07:57 |
Axel Guckelsberger Messages: 354 Registered: July 2009 |
Senior Member |
|
|
Hi Tony,
like others said before: first you need to be sure about the goals of
your DSL. What benefits are (or should be) involved in created models
for it? Only better understandability of problems or use cases of your
domain? Or also an improved productivity by further processing of these
models (e.g. by transforming them to other models or generating code
and/or further artifacts from them)? How should model creation look like
/ should be done: there are different types of notations possible, like
textual, graphical, structural (table, trees, forms) and hybrid
combinations.
After you answered these basic questions you can look for a set of
tooling supporting your demands. EMF/Ecore as well as Xtext will
probably be included in this set, but the Eclipse modeling ecosystem
offers much more, too.
To notice the benefits of meta modeling (building your meta models with
terms of Ecore) against a code-based definition, you might read some
theoretic basics about model-driven software development (mdsd) in
general. Briefly this is primarily about abstraction, precise notations
and terminology understandable also for your domain experts (who do not
necessarily have technical experience). Also a meta model helps to
ensure the integrity of your DSL, as it contains some important
constraints. The meta model defines how a model may look like and how
it's elements may work together.
To sum it up: if you are clear about your requirements, your goals and
your vision, you can probably better incorporate the features of Xtext
and other modeling frameworks of Eclipse into your plan/roadmap.
HTH
Axel
Am 23.05.2016 um 15:59 schrieb Tony Chou:
> Please don't be offended by the topic/subject. I am just trying to
> figure this out.
>
> The Xtext framework comes in with loaded features and I'm still
> overwhelmed by the learning curve required to pick up the vast amount
> of information and knowledge needed to drive this thing. I have done
> some studies on Rational Software Architect and did some OCL and was not
> able to understand ECore at that time. Then I started looking into DSL
> and then ended up at Xtext. I am amazed that for an Xtext project it
> generates so much code and projects for me. Now I decided to seek help
> in this forum.
>
> So, after going through all the nice Xtext rules definition process,
> what am I supposed to do with my DSL?
>
> Going thru Xtext process, a rule is a rule and it is fun to figure out
> the grammar. But afterwards, it still defines a language that someone
> need to be able to develop. Is its purpose so that a business person who
> is more familiar with the domain can quickly define the necessary
> "objects" used in that domain and be able to coordinate them more
> conveniently? In some way, this extra layer almost seems a waste of
> time. Why can't I simply define the underlying class using Java directly
> and use reflection to produce the UI?
>
> I am not able to figure out the "saves" if all we want is so that it can
> use ECore to do provide more dynamic modeling capabilities. Doesn't
> Java's reflection API good enough for this? I am sorry but I just can't
> understand the connections and advantages of using Xtext and really can
> use some help in guiding me.
> Nowadays you have all kind of frameworks that are supposed to help you
> with your work. For example, you could have your aspect annotation do
> logging or database transaction management, and the Spring frameworks API.
>
> Could someone please shed some light?
>
> Sincerely,
>
> Xtext 101 Student
>
>
>
>
>
|
|
| | | | | |
Re: Real business benefits of Xtext [message #1733220 is a reply to message #1733218] |
Wed, 25 May 2016 13:25 |
Ed Merks Messages: 33224 Registered: July 2009 |
Senior Member |
|
|
Tony,
If you're concerned about performance measure it.
EMF is industrial strength, and so while you might not guess from
looking at implementation code, if you actually measure, you'll find
that eObject.eGet(eStructureFeature) is faster than hashMap.get(key).
I.e., it's faster to look up reflectively (using EMF reflection) the
value of a feature from an EObject than it is to lookup a value in a
HashMap by hashed key. And you've no doubt never asked the question,
will using a HashMap slow my code down?
On 25.05.2016 15:16, Tony Chou wrote:
> Hi Chris -
> The performance I meant was runtime.
>
> When I stepped through the Unit Test code, I noticed it was calling
> ECore code, which makes sense to me since DSL is built on top of ECore.
>
> So, if everything runs in ECore, doesn't that slow things down?
>
> Sincerely,
> XText 102 Student
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Sun Oct 06 07:11:40 GMT 2024
Powered by FUDForum. Page generated in 0.05307 seconds
|