flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christofer Dutz <christofer.d...@c-ware.de>
Subject AW: [FLEXJS] AMF (was Re: AW: lib sprite flexjs,add graphics.as (canvas))
Date Thu, 03 Dec 2015 10:18:16 GMT
Unfortunately for me BlazeDS consists of two parts ... 
1. The Libs for Serializing / Deserializing AMF Data ... this rocks
2. The Server, that deals with authentication, managing of sessions, ressources, polling ...
this sucks greatly 

Even if the Server part works maintaining is is a Nightmare. The people having created the
internal software architecture of it probably never read a book about software architecture,
cause it's more like a self supporting set of hacks. I get sweaty hands whenever I read the
letter combination "CVE" on one of the Flex mailing lists and pray it's not BlazeDS and I
don't have to go down that rabbit-hole again ;-)

I have had several projects with BlazeDS as a server and I had some really bad days/nights
figuring out problems. The Spring solution sort of looks like it uses the good parts for the
serialization and doesn't use the bad ones at all ... guess that's why I like that approach.


Building something that uses the server part and uses a something else for JSON sort of doesn't
feel good ;-) 

Chris

________________________________________
Von: omuppi1@gmail.com <omuppi1@gmail.com> im Auftrag von OmPrakash Muppirala <bigosmallm@gmail.com>
Gesendet: Mittwoch, 2. Dezember 2015 21:31
An: dev@flex.apache.org
Betreff: Re: [FLEXJS] AMF (was Re: AW: lib sprite flexjs,add graphics.as (canvas))

On Wed, Dec 2, 2015 at 1:37 AM, Christofer Dutz <christofer.dutz@c-ware.de>
wrote:

> Actually I don't think you need to add anything to BlazeDS I think the
> Spring-Flex guys for example already did that work.


> I know that you can configure Spring MVC Rest Controllers to
> auto-serialize data depending on the Accept header of a request. So if xml
> is requested, a xml response is sent back, if json is requested, json is
> returned. With Spring-Flex spring uses BlazeDS to serialize AMF if
> requested by the client. I think It was the AmfView approach described here:
>
> http://docs.spring.io/spring-flex/docs/1.5.x/reference/html/#amf-rest


That's pretty cool.  I have not had a chance to work with this feature.


>
>
> The second thing I stumbled across, is that Flash doesn't support PUT and
> DELETE as the underlying Browsers don't consistently support them. For this
> Spring comes with a Servlet filter where you can send a post or get with an
> URL parameter "_method" which then replaces the method on the server and
> allows to fully use REST services.
>
> But all of this only works with Spring ... so if you are not using Spring,
> you probably have to implement this stuff yourself.
>

Which is why I want to add this functionality to BlazeDS.  Hopefully this
would become a one stop server solution for FlexJS apps.


>
> Chris
>
> ________________________________________
> Von: omuppi1@gmail.com <omuppi1@gmail.com> im Auftrag von OmPrakash
> Muppirala <bigosmallm@gmail.com>
> Gesendet: Dienstag, 1. Dezember 2015 21:42
> An: dev@flex.apache.org
> Betreff: Re: [FLEXJS] AMF (was Re: AW: lib sprite flexjs,add graphics.as
> (canvas))
>
> I love AMF as well (static typed value objects, one way serialization, no
> deserialization required, small file size, etc.)  The biggest problem I
> have is with BlazeDS as AMF server.   Because with BlazeDS, all AMF
> request/responses need to be done via POST. This means that building true
> REST based webservices with BlazeDS/AMF is not possible.
>
> To fix this problem, here is the approach I am taking right now on my apps
> on production.
>
>    1. On the server side, all value objects live as POJOs
>    2. Create Actionscript stubs for all these classes using GraniteDS's AS3
>    generator (GAs3)  Include these AS3 classes in the Flex app.
> Development
>    is a breeze because I know the types, code completion works, etc.
>    3. Create a REST endpoint (using any tech, I use Apache CXF)
>    4. The Flex client makes a request to a REST webservice with a
>    querystring parameter: resultFormat=amf
>    - The REST endpoint generates the POJOs based on application logic and
>       uses the Java -> AMF serializer jar from the BlazeDS library and
> returns
>       data
>       5. The HTML/JS client makes a request to a REST webservice with a
>    querystring parameter: resultFormat=json
>    - The REST endpoint uses the same application logic code. Then uses a
>       Java -> JSON converter and returns the data
>
> This way, we get all the benefits of REST, caching, etc. at the same time
> use AMF for Flex clients.  And the same data is used by a Javascript client
> in the form of JSON objects.
>
> This paradigm will perfectly fit the spirit of FlexJS.  Where you optimize
> the Flash version to work the best with AMF.  The JS version would use the
> JSON version of the same data and run exactly the same way.
>
> If you think about it, the objects that AMF serializes are just objects
> with type information.  JSON, by definition describes on the objects but
> with no type info.  Any type information AMF has will be of no use in the
> Javascript application.  Which means that all that type information is
> extra cruft that the JS AMF deserializer would throw away.  Consuming data
> as JSON for the JS version would in fact be faster.
>
> Likewise, consuming data as AMF for the Flash version is the best in terms
> of performance.  Deserializing the string into JSON seems unnecessary when
> AMF does not need any deserializing at all.
>
> This is something that I am very interested in and will add to BlazeDS,
> that is when I find some time :-(
>
> In the meantime, if someone wants to help out, this is the area you could
> concentrate on.  Especially those who want to see AMF in FlexJS, please do
> contribute some time to make this happen.
>
> Thanks,
> Om
>
>
> On Tue, Dec 1, 2015 at 11:59 AM, Harbs <harbs.lists@gmail.com> wrote:
>
> > I’m pretty sure you can use ArrayBuffer.transfer() in place of
> > buffer.slice().
> >
> > On Dec 1, 2015, at 9:55 PM, Alex Harui <aharui@adobe.com> wrote:
> >
> > >
> > >
> > > On 12/1/15, 11:52 AM, "Harbs" <harbs.lists@gmail.com> wrote:
> > >
> > >> I don’t think that’s a problem. I think Uint8ClampedArray is just for
> > >> Canvas bitmap data.
> > >
> > > It was the "1. ArrayBuffer has no slice method in IE 10." that also
> > caused
> > > me to worry.
> > >
> > > -Alex
> > >
> >
> >
>

Mime
View raw message