Is there best practice/pattern for using real time massaging protocol with swiz

5 views
Skip to first unread message

him_aeng

unread,
Jul 15, 2009, 9:58:57 PM7/15/09
to Swiz Framework
Recently, I just finished my project two day ago. The problem was my
project rely heavily on message pushing from server and I used
Cairngorm standard edition, which was not support for messaging
consumer because since version 2.1 Adobe decided to separated the
enterprise feature to cairngorm enterprise version (in this case is
getConsumer() method) , which use well with only LCDS and my project
use BlazeDS, so the ugly code was happened. I was force by Cairngorm
to put some consumer logic in view and some in modelLocator very ugly
code.

When I look into swiz delegate, mediate, and view pattern (which
suggest by http://www.returnundefined.com/2009/05/swiz-example-application-with-presentation-model-pattern).
I think I found the elegant way to refactor my latest project.

So before I start to refactor, I want to know the best practice/
pattern for working with real time messaging protocol. such as "where
should I put the message result and fault handler?" "When and Where
that I should subscribe and send and wait for messaging to coming and
going out?" etc.

Thank you in advance
Tanakorn Numrubporn

Nathan Mische

unread,
Jul 16, 2009, 10:09:48 AM7/16/09
to swiz-fr...@googlegroups.com
I don't know if there is a best practice, but here is an example I put together some time ago. It uses an older version of Swiz, and I would probably do things a bit differently today (i.e. mediate the events in the main view), but it should give you an idea of one way to approach messaging with Swiz.

http://www.mischefamily.com/demos/swizchat/srcview/index.html

Note: this is not a working demo as I don't have BlazeDS set up on my blog, but you can right click to view source. In a nutshell, my producer and consumer are auto wired into my controller and I use Swiz to forward standard messaging events from the controller to the view.

Best,

--Nathan

him_aeng

unread,
Jul 16, 2009, 10:57:46 PM7/16/09
to Swiz Framework
OH, thank you very much. I already look into you source and understand
the pattern and purpose of the application.

Thank again.

On Jul 16, 9:09 pm, Nathan Mische <nmis...@gmail.com> wrote:
> I don't know if there is a best practice, but here is an example I put
> together some time ago. It uses an older version of Swiz, and I would
> probably do things a bit differently today (i.e. mediate the events in the
> main view), but it should give you an idea of one way to approach messaging
> with Swiz.
>
> http://www.mischefamily.com/demos/swizchat/srcview/index.html<https://scorpio-dev.wharton.upenn.edu/users/nmische/swizchat/demo/swi...>
>
> Note: this is not a working demo as I don't have BlazeDS set up on my blog,
> but you can right click to view source. In a nutshell, my producer and
> consumer are auto wired into my controller and I use Swiz to forward
> standard messaging events from the controller to the view.
>
> Best,
>
> --Nathan
>
> On Wed, Jul 15, 2009 at 9:58 PM, him_aeng <s8432...@gmail.com> wrote:
>
> > Recently, I just finished my project two day ago. The problem was my
> > project rely heavily on message pushing from server and I used
> > Cairngorm standard edition, which was not support for messaging
> > consumer because since version 2.1 Adobe decided to separated the
> > enterprise feature to cairngorm enterprise version (in this case is
> > getConsumer() method) , which use well with only LCDS and my project
> > use BlazeDS, so the ugly code was happened. I was force by Cairngorm
> > to put some consumer logic in view and some in modelLocator very ugly
> > code.
>
> > When I look into swiz delegate, mediate, and view pattern (which
> > suggest by
> >http://www.returnundefined.com/2009/05/swiz-example-application-with-...
> > ).
Reply all
Reply to author
Forward
0 new messages