You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Yasser Zamani <ya...@apache.org> on 2018/12/05 09:37:26 UTC

RE: Would we need to achieve better place in trends ranking?

>From: Ken McWilliams <ke...@gmail.com>
>Sent: Wednesday, July 19, 2017 5:55 AM
>To: Struts Developers List <de...@struts.apache.org>
>Subject: Re: Would we need to achieve better place in trends ranking?
>
>Lukasz it's good to hear the JSON plugin is on the horizon. For my own work I
>created a new JSON Result type using FlexJson, for some reason I liked it better
>when serializing JPA Entities, it will by default serialize primitive types on the
>object but will not travel the graph unless you explicitly tell it the collections to
>traverse. Because it was the business of the action to fetch what was needed (so
>it knew what needed to be
>returned) there was no issue specifying these strings. Each action had an instance
>of the JSON Serializer, along with a getter for it. After setting it the way I wanted,
>the result just fetched the configured instance from the action it self. It didn't
>have any pretty annotations or anything but it was mindlessly simple to configure
>and using the object that performed the Json serialization directly was very
>convenient.

Hi Ken, I hope this mail finds you well :)

I forgot back to you that Struts since 2.5.14 now is able to use not only FlexJson but also any customer specified JSON library. Please see [1] and feel free for any further comments.

Please follow inline comments below....

>
>Yasser get the code and start making changes... no harm in doing that. I've never
>seen anything but reasonableness from the struts developers if they like the
>change and it won't break things for others I'm sure they'll be happy to have more
>people on team struts.
>
>MORE LESS OFF TOPIC
>Regarding keeping up with the competition: I've started a project with Spark
>framework [sparkjava.com]. It is a pretty cool framework. Struts and Spring and
>many others are in a certain vein, this thing feels a lot more like development in
>Python, PHP, having a functional/imperative programming feel rather than an OO
>one... It is pretty refreshing to hardly be required to create any objects. My
>motivation was to use Dagger2 for DI, which does not work well with JEE (in a
>container environment). Dagger2 needs to be able to travel the whole graph so it
>can't tolerate any "magic", other systems performing DI/reflective magic or even
>using external configuration, like an xml file to determine what to instantiate, so
>that eliminates a lot of web frameworks. It could still be made to work, but it
>would have to start over at each point it couldn't trace, and _you_ would have to
>identify those points and work around that. All in all, not very practical.

Thanks a lot! I probed both sparkjava and dagger2 on internet via googling "sparkjava vs spring boot" and "dagger 2 vs spring" and reading some articles. I can conclude them that it seems sparkjava is best when you want to learn then build a "not-enterprise" web app fast. Struts but somehow is for enterprise and heavy wen apps. However, I agree that sparkjava's "microservices" concept must be added to our Struts "probe and implement" plan, thank you. I found dagger2 best when there are limited resources and we need an urgent performance e.g. in mobile devices. But Struts unfortunately is not able to be used in mobile app developments so we can postpone dagger 2 to when Struts will be able.

>
>Any ways this thing is very different from the Java frameworks I've seen, it's really
>simple, it really seems like what is going on in a lot of other languages. Really at
>this point I don't know what it could bring to struts2... like adding a whole
>functional API to struts would probably be too radical.
>

@dev wdyt? I thought what about add integration with front-end trends e.g. React, Angular, Vu.js, Node.js? and improve Struts internals with concept trends e.g. microservices, DIs and etc? I think these will "make Struts great again" :] And make us also with Struts :)

Kind Regards.

Re: Would we need to achieve better place in trends ranking?

Posted by Martin Gainty <mg...@hotmail.com>.
>
>
> MG> remembering days of barosso-wannamacher regime the JS library du-jour
> >was 'sitemesh' has struts2 deprecated support for sitemesh?
>

SiteMesh had nothing to do with JS.

MG>more of an alert to JS programmers that for title/body/page.properties decorations can be handled by sitemesh
MG>struts-plugin
MG><struts>
    <bean class="org.apache.struts2.sitemesh.FreeMarkerPageFilter" static="true" optional="true"/>
    <bean class="org.apache.struts2.sitemesh.VelocityPageFilter" static="true" optional="true"/>
</struts>

MG>FMPageFilter would process page title and body by inserting attrs into SimpleHash model
         model.put("title",page.getTitle());
            model.put("body",page.getBody());
            model.put("page.properties", new SimpleHash(page.getProperties()));
            // finally, render it
            template.process(model, res.getWriter());

MG>VPageFilter would insert attrs into velocity Context then render
       context.put("title",page.getTitle());
            context.put("body",page.getBody());
            // finally, render it
            PrintWriter writer = res.getWriter();
            template.merge(context, writer);
            writer.flush();

MG>in the end JS coder can inject canned/customised decorator JS into their function with '@' sign
https://www.sitepoint.com/javascript-decorators-what-they-are/
[https://www.sitepoint.com/wp-content/themes/sitepoint/assets/images/icon.javascript.png]<https://www.sitepoint.com/javascript-decorators-what-they-are/>

JavaScript Decorators: What They Are and When to Use Them<https://www.sitepoint.com/javascript-decorators-what-they-are/>
In its simplest form, a decorator is simply a way of wrapping one piece of code with another — literally “decorating” it. This is a concept you might well have heard of previously as ...
www.sitepoint.com

MG>the JS coder would say I need transpiler support on my browser for decorating JS functions is not yet supported

MG>in that case import sitemesh-plugin from struts-2.1.6 and use fm or vm macros for site decoration

MG​>Future considerations:
MG>when ECMAScript gurus incorporate transpiler support for Decorator JS Code into ECMAscript standard
MG>and chrome,edge,safari,opera and firefox support ECMA standard that has transpiler support
MG>organisations that supported their-own HTML decorations (Spring/Struts)
MG> can safely deprecate their own decorators and implement JS decorations

Re: Would we need to achieve better place in trends ranking?

Posted by Dave Newton <da...@gmail.com>.
>
>
> MG> remembering days of barosso-wannamacher regime the JS library du-jour
> >was 'sitemesh' has struts2 deprecated support for sitemesh?
>

SiteMesh had nothing to do with JS.

RE: Would we need to achieve better place in trends ranking?

Posted by Yasser Zamani <ya...@apache.org>.
>MG>remembering days of barosso-wannamacher regime the JS library du-jour
>was 'sitemesh'
>MG>has struts2 deprecated support for sitemesh?

Hi Martin,

No not yet AFAIK. However maybe we will have to because Sitemesh seems has been abolished in 2015 [1]

Regards.

[1] https://github.com/sitemesh/sitemesh3/releases

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Would we need to achieve better place in trends ranking?

Posted by Martin Gainty <mg...@hotmail.com>.
MG>agreed ..pls see ? below
________________________________
From: Dave Newton <da...@gmail.com>
Sent: Thursday, December 6, 2018 2:54 PM
To: Struts Developers List
Subject: Re: Would we need to achieve better place in trends ranking?

On Thu, Dec 6, 2018 at 2:44 PM Yasser Zamani <ya...@apache.org>
wrote:

> Instead we may focus to facilitate "show mobile version of user web
> app". I don't know if S2 already have such facilities e.g. via Tiles or
> SiteMesh plugin.
>

Desktop vs. Mobile is now solidly in the realm of CSS, possibly with
client-side JS framework. S2 doesn't really try to solve those kinds of
problems.

If anything we could provide a responsive-first theming mechanism, but the
churn in that space makes it... problematic. A Bootstrap or Foundation
theme (or both) would be interesting, but it's a fair amount of maintenance
work, and people that are using those frameworks have things pretty well in
place already (in my experience). Making it general-purpose enough would be
tricky.


> I also currently have no vision on those front-end trends, am exploring.
> To be frank, something similar to Struts JQuery Plugin was my first
> theory, however, it may be absurd.
>

Anything more complicated than jQuery will be API-driven and likely
wouldn't need any support on the S2 side. I could see maybe exposing
endpoints or whatever via a JS call, e.g., any of the several API
documentation attempts, but... I don't know.

MG>remembering days of barosso-wannamacher regime the JS library du-jour was 'sitemesh'
MG>has struts2 deprecated support for sitemesh?


> Thank you. I need to explore into uSvcs to reveal if S2 need to/can be
> used in such trends e.g. clouds.
>

"Clouds" are just servers-not-on-site. It's too heavy for serverless (IMO,
at least as it stands right now), and it can already be deployed on any
reasonable infrastructure.

d.

Re: Would we need to achieve better place in trends ranking?

Posted by Dave Newton <da...@gmail.com>.
Being smaller than Spring Boot is a pretty low bar ;)

But interesting--I actually would have guessed both would be more
resource-intensive; I'm clearly behind-the-times.

On Thu, Dec 20, 2018 at 5:18 AM Johannes Geppert <jo...@apache.org> wrote:

> In my first tests it looks like Struts2 is not to heavy to run as a lambda
> function.
> In fact the bundled jar is smaller than a similar Spring Boot version and
> the used memory is lower as well.
>
> See my small comparison between these both serverless solutions:
>
> https://www.jgeppert.com/2018/05/serverless-aws-lambda-performance-of-apache-struts2-vs-spring-boot/
>
> Best Regards
>
> Johannes
>
> >
> > >> Thank you. I need to explore into uSvcs to reveal if S2 need to/can be
> > >> used in such trends e.g. clouds.
> > >>
> > >
> > >"Clouds" are just servers-not-on-site. It's too heavy for serverless
> > (IMO, at least
> > >as it stands right now), and it can already be deployed on any
> reasonable
> > >infrastructure.
> >
> > Fortunately I discovered there is already a cloud plugin for Struts [1].
> >
> > Regards.
> >
>


-- 
em: davelnewton@gmail.com
mo: 908-380-8699
tw: @dave_newton <https://twitter.com/dave_newton>
li: dave-newton <https://www.linkedin.com/in/dave-newton/>
gh: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
bl: Bucky Bits <http://buckybits.blogspot.com/>
sk: davelnewton_skype

Re: Would we need to achieve better place in trends ranking?

Posted by Johannes Geppert <jo...@apache.org>.
In my first tests it looks like Struts2 is not to heavy to run as a lambda
function.
In fact the bundled jar is smaller than a similar Spring Boot version and
the used memory is lower as well.

See my small comparison between these both serverless solutions:
https://www.jgeppert.com/2018/05/serverless-aws-lambda-performance-of-apache-struts2-vs-spring-boot/

Best Regards

Johannes

>
> >> Thank you. I need to explore into uSvcs to reveal if S2 need to/can be
> >> used in such trends e.g. clouds.
> >>
> >
> >"Clouds" are just servers-not-on-site. It's too heavy for serverless
> (IMO, at least
> >as it stands right now), and it can already be deployed on any reasonable
> >infrastructure.
>
> Fortunately I discovered there is already a cloud plugin for Struts [1].
>
> Regards.
>

RE: Would we need to achieve better place in trends ranking?

Posted by Yasser Zamani <ya...@apache.org>.

>-----Original Message-----
>From: Dave Newton <da...@gmail.com>
>Sent: Thursday, December 6, 2018 11:24 PM
>To: Struts Developers List <de...@struts.apache.org>
>Subject: Re: Would we need to achieve better place in trends ranking?
>
>On Thu, Dec 6, 2018 at 2:44 PM Yasser Zamani <ya...@apache.org>
>wrote:
>
>> Instead we may focus to facilitate "show mobile version of user web
>> app". I don't know if S2 already have such facilities e.g. via Tiles
>> or SiteMesh plugin.
>>
>
>Desktop vs. Mobile is now solidly in the realm of CSS, possibly with client-side JS
>framework. S2 doesn't really try to solve those kinds of problems.
>
>If anything we could provide a responsive-first theming mechanism, but the churn
>in that space makes it... problematic. A Bootstrap or Foundation theme (or both)
>would be interesting, but it's a fair amount of maintenance work, and people that
>are using those frameworks have things pretty well in place already (in my
>experience). Making it general-purpose enough would be tricky.

Thank you Dave. You were right that it's in the realm of CSS; and fortunately there is already a bootstrap and cloud plugin for Struts [1].

[1] https://github.com/struts-community-plugins

>
>
>> I also currently have no vision on those front-end trends, am exploring.
>> To be frank, something similar to Struts JQuery Plugin was my first
>> theory, however, it may be absurd.
>>
>
>Anything more complicated than jQuery will be API-driven and likely wouldn't
>need any support on the S2 side. I could see maybe exposing endpoints or
>whatever via a JS call, e.g., any of the several API documentation attempts, but...
>I don't know.
>

Yes I also think API Documentation could be added to plan (like websocket) because I already remember a user demand for Struts-Swagger plugin [2].

[2] https://lists.apache.org/thread.html/fd07fec16e9a5595e117008c6ec11df924ea2f339d8fade842aff82f@%3Cdev.struts.apache.org%3E

>
>> Thank you. I need to explore into uSvcs to reveal if S2 need to/can be
>> used in such trends e.g. clouds.
>>
>
>"Clouds" are just servers-not-on-site. It's too heavy for serverless (IMO, at least
>as it stands right now), and it can already be deployed on any reasonable
>infrastructure.

Fortunately I discovered there is already a cloud plugin for Struts [1].

Regards.

Re: Would we need to achieve better place in trends ranking?

Posted by Dave Newton <da...@gmail.com>.
On Thu, Dec 6, 2018 at 2:44 PM Yasser Zamani <ya...@apache.org>
wrote:

> Instead we may focus to facilitate "show mobile version of user web
> app". I don't know if S2 already have such facilities e.g. via Tiles or
> SiteMesh plugin.
>

Desktop vs. Mobile is now solidly in the realm of CSS, possibly with
client-side JS framework. S2 doesn't really try to solve those kinds of
problems.

If anything we could provide a responsive-first theming mechanism, but the
churn in that space makes it... problematic. A Bootstrap or Foundation
theme (or both) would be interesting, but it's a fair amount of maintenance
work, and people that are using those frameworks have things pretty well in
place already (in my experience). Making it general-purpose enough would be
tricky.


> I also currently have no vision on those front-end trends, am exploring.
> To be frank, something similar to Struts JQuery Plugin was my first
> theory, however, it may be absurd.
>

Anything more complicated than jQuery will be API-driven and likely
wouldn't need any support on the S2 side. I could see maybe exposing
endpoints or whatever via a JS call, e.g., any of the several API
documentation attempts, but... I don't know.


> Thank you. I need to explore into uSvcs to reveal if S2 need to/can be
> used in such trends e.g. clouds.
>

"Clouds" are just servers-not-on-site. It's too heavy for serverless (IMO,
at least as it stands right now), and it can already be deployed on any
reasonable infrastructure.

d.

Re: Would we need to achieve better place in trends ranking?

Posted by Yasser Zamani <ya...@apache.org>.

On 12/5/2018 5:58 PM, Dave Newton wrote:
> On Wed, Dec 5, 2018 at 4:37 AM Yasser Zamani <ya...@apache.org>
> wrote:
> 
>> I found dagger2 best when there are limited resources and we need an
>> urgent performance e.g. in mobile devices. But Struts unfortunately is not
>> able to be used in mobile app developments so we can postpone dagger 2 to
>> when Struts will be able.
>>
> 
> Dagger seems to be cross-platform; no reason it couldn't be used in a POJ
> project, but as you say, it seems a replacement for, not an adjunct to,
> existing DI engines. We could consider using it for internal injection
> rather than the original Guice, and allowing users to use it, but... I
> don't know. Would have to think about that and spin some PoCs.

Yes I agree. S2's internal injection cycles aren't still obvious for me
enough but why not. To compete performance we should devise to reform to
best current DI tool when is applicable.

> 
> I don't see any reason to (or even a reasonable ability to) target S2 at
> mobile.
> 

+1

Instead we may focus to facilitate "show mobile version of user web
app". I don't know if S2 already have such facilities e.g. via Tiles or
SiteMesh plugin.

> 
>> @dev wdyt? I thought what about add integration with front-end trends e.g.
>> React, Angular, Vu.js, Node.js?
> 
> 
> NodeJS isn't really front-end.
> 
> I don't know what would be added to S2 to "integrate" it into a front end;
> it already does JSON reasonably well-ish. Web socket support would be about
> the only thing "missing" in this regard.
> 

Thank you. "Web socket support" recorded :)

I also currently have no vision on those front-end trends, am exploring.
To be frank, something similar to Struts JQuery Plugin was my first
theory, however, it may be absurd.

> 
>> and improve Struts internals with concept trends e.g. microservices, DIs
>> and etc?
> 
> 
> IMO w/o some major gutting S2 won't be a (good) microservice framework.
> uSvcs are more single-function endpoints, while S2 is meant for a
> collection of endpoints. We could consider Java-based config (again/still)
> and but I'm not 100% sure what that buys the framework overall.
> 

Thank you. I need to explore into uSvcs to reveal if S2 need to/can be
used in such trends e.g. clouds.

> I should poke around a bit in the Java world again and re-familiarize
> myself with some S2 internals before saying too much, though :/

Thank you very much! As a prominent S2's member, with your advises S2
can excel and excel day by day :)

Kind regards.

Re: Would we need to achieve better place in trends ranking?

Posted by Dave Newton <da...@gmail.com>.
On Wed, Dec 5, 2018 at 4:37 AM Yasser Zamani <ya...@apache.org>
wrote:

> I found dagger2 best when there are limited resources and we need an
> urgent performance e.g. in mobile devices. But Struts unfortunately is not
> able to be used in mobile app developments so we can postpone dagger 2 to
> when Struts will be able.
>

Dagger seems to be cross-platform; no reason it couldn't be used in a POJ
project, but as you say, it seems a replacement for, not an adjunct to,
existing DI engines. We could consider using it for internal injection
rather than the original Guice, and allowing users to use it, but... I
don't know. Would have to think about that and spin some PoCs.

I don't see any reason to (or even a reasonable ability to) target S2 at
mobile.


> @dev wdyt? I thought what about add integration with front-end trends e.g.
> React, Angular, Vu.js, Node.js?


NodeJS isn't really front-end.

I don't know what would be added to S2 to "integrate" it into a front end;
it already does JSON reasonably well-ish. Web socket support would be about
the only thing "missing" in this regard.


> and improve Struts internals with concept trends e.g. microservices, DIs
> and etc?


IMO w/o some major gutting S2 won't be a (good) microservice framework.
uSvcs are more single-function endpoints, while S2 is meant for a
collection of endpoints. We could consider Java-based config (again/still)
and but I'm not 100% sure what that buys the framework overall.

I should poke around a bit in the Java world again and re-familiarize
myself with some S2 internals before saying too much, though :/

Dave