[Modeling with Pharo] How to model a simple human interaction.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Modeling with Pharo] How to model a simple human interaction.

sergio_101
Hey all..

I got my first paying gig that i am able to use pharo with, and i am on the last leg before calling it complete.

Here’s what I need to do..

This application accepts SMS text messages. It allows the user to send images via MMS and place an order to a print house for those images..  it then compiles the order, and submits it to the order processing system and makes the prints.

The last thing I need to zero in on is handling the interaction. Believe it or not, I have never modeled such an interaction. The interaction goes:

- user sends images{s)
- bot says ‘thanks’ and asks if there are more
- user types ‘done’ or sends more
- on ‘done’ bot asks for print size
- bot says ‘thanks’ and the interaction is done. order is processed.

my first inclination is to use a state machine, progressing through order each time the user enters ‘done’.. 

does this sound reasonable, or is there a better model/design pattern for this interaction?

Thanks!


----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

signature.asc (852 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Modeling with Pharo] How to model a simple human interaction.

stepharong
Hi sergio

Hey all..

I got my first paying gig that i am able to use pharo with, and i am on the last leg before calling it complete.

super!
I'm really happy for you. 
just this makes pharo and all our effort worth it. 

Here’s what I need to do..

This application accepts SMS text messages. It allows the user to send images via MMS and place an order to a print house for those images..  it then compiles the order, and submits it to the order processing system and makes the prints.

The last thing I need to zero in on is handling the interaction. Believe it or not, I have never modeled such an interaction. The interaction goes:

- user sends images{s)
- bot says ‘thanks’ and asks if there are more
- user types ‘done’ or sends more
- on ‘done’ bot asks for print size
- bot says ‘thanks’ and the interaction is done. order is processed.

my first inclination is to use a state machine, progressing through order each time the user enters ‘done’..

does this sound reasonable,

Yes it seems. 

After you could also have a queue of command. 

or is there a better model/design pattern for this interaction?

You can look at the state pattern. It is good for implementing state machine. 

Stef


Thanks!


----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101



--
Using Opera's mail client: http://www.opera.com/mail/
Reply | Threaded
Open this post in threaded view
|

Re: [Modeling with Pharo] How to model a simple human interaction.

Paul DeBruicker
In reply to this post by sergio_101
This may be overkill for your use but would love to have an MIT licensed set of classes that allow for/enable something like this:


https://medium.com/assist/theres-a-dozen-ways-to-order-a-coffee-why-do-dumb-bots-only-allow-one-27230542636d#.laljhpyt5



sergio ruiz wrote
Hey all..

I got my first paying gig that i am able to use pharo with, and i am on the last leg before calling it complete.

Here’s what I need to do..

This application accepts SMS text messages. It allows the user to send images via MMS and place an order to a print house for those images..  it then compiles the order, and submits it to the order processing system and makes the prints.

The last thing I need to zero in on is handling the interaction. Believe it or not, I have never modeled such an interaction. The interaction goes:

- user sends images{s)
- bot says ‘thanks’ and asks if there are more
- user types ‘done’ or sends more
- on ‘done’ bot asks for print size
- bot says ‘thanks’ and the interaction is done. order is processed.

my first inclination is to use a state machine, progressing through order each time the user enters ‘done’.. 

does this sound reasonable, or is there a better model/design pattern for this interaction?

Thanks!


----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

signature.asc (852 bytes) <http://forum.world.st/attachment/4937293/0/signature.asc>
Reply | Threaded
Open this post in threaded view
|

Re: [Modeling with Pharo] How to model a simple human interaction.

philippeback
Looks awesome.

Now, how hard would it be to reuse a WATask from Seaside from normal, non web code?

A lot of WAxxx concepts could be brought back into nornal "Spec/Morphic" apps, like WASession, WATask, filters etc.

Phil 

On Sun, Mar 5, 2017 at 12:42 AM, Paul DeBruicker <[hidden email]> wrote:
This may be overkill for your use but would love to have an MIT licensed set
of classes that allow for/enable something like this:


https://medium.com/assist/theres-a-dozen-ways-to-order-a-coffee-why-do-dumb-bots-only-allow-one-27230542636d#.laljhpyt5




sergio ruiz wrote
> Hey all..
>
> I got my first paying gig that i am able to use pharo with, and i am on
> the last leg before calling it complete.
>
> Here’s what I need to do..
>
> This application accepts SMS text messages. It allows the user to send
> images via MMS and place an order to a print house for those images..  it
> then compiles the order, and submits it to the order processing system and
> makes the prints.
>
> The last thing I need to zero in on is handling the interaction. Believe
> it or not, I have never modeled such an interaction. The interaction goes:
>
> - user sends images{s)
> - bot says ‘thanks’ and asks if there are more
> - user types ‘done’ or sends more
> - on ‘done’ bot asks for print size
> - bot says ‘thanks’ and the interaction is done. order is processed.
>
> my first inclination is to use a state machine, progressing through order
> each time the user enters ‘done’.. 
>
> does this sound reasonable, or is there a better model/design pattern for
> this interaction?
>
> Thanks!
>
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>
> signature.asc (852 bytes)
> &lt;http://forum.world.st/attachment/4937293/0/signature.asc&gt;





--
View this message in context: http://forum.world.st/Modeling-with-Pharo-How-to-model-a-simple-human-interaction-tp4937293p4937308.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Reply | Threaded
Open this post in threaded view
|

Re: [Modeling with Pharo] How to model a simple human interaction.

stepharong
In reply to this post by Paul DeBruicker
On Sun, 05 Mar 2017 00:42:44 +0100, Paul DeBruicker <[hidden email]>  
wrote:

> This may be overkill for your use but would love to have an MIT licensed  
> set
> of classes that allow for/enable something like this:
>
>
> https://medium.com/assist/theres-a-dozen-ways-to-order-a-coffee-why-do-dumb-bots-only-allow-one-27230542636d#.laljhpyt5

looks nice.

the first step is to have something basic and improve.

Stef

Reply | Threaded
Open this post in threaded view
|

Re: [Modeling with Pharo] How to model a simple human interaction.

stepharong
In reply to this post by philippeback

Looks awesome.

Now, how hard would it be to reuse a WATask from Seaside from normal, non web code?

A lot of WAxxx concepts could be brought back into nornal "Spec/Morphic" apps, like WASession, WATask, filters etc.

Indeed and we can accept them and cocoon them :)

Reply | Threaded
Open this post in threaded view
|

Re: [Modeling with Pharo] How to model a simple human interaction.

aryehof
In reply to this post by sergio_101
Your using an object-oriented language, why not use an object domain model?  Consider that Kristen Nygaard stated that an object-oriented "program execution is regarded as a physical model, simulating the behavior of either a real or imaginary part of the world."  By physical model, he really is meaning a "direct model" where you directly represent the concepts of your problem domain as objects that interact with each other.

Sure, you could use a state machine, but why build a model (your domain problem) on top of a model (a state machine) using a paradigm intended to support a different way.  State machines are a favored way to model process and state in functional programming.

A domain model would separate the user interaction from your domain problem itself.  You would model an Order that knows a User and one or more Images.

Anyway, hopefully some food for thought.
-- Aryeh