Contexts with a Single Role

64 views
Skip to first unread message

Chris McLeod

unread,
Oct 14, 2016, 9:20:42 PM10/14/16
to object-composition
It seems Contexts are about encapsulating use cases and DCI in general is to help clarify collaborations among roles.  I think I have a context which only has one role, but this seems like I'm missing something.  If there is no collaboration do I have a valid context and use case?

The use case I'm thinking of is an oauth hub.  So I have a dumb "connection" object that would hold information about a third party oauth provider such as client id and client secret.  The context would be "GetAuthorizationRedirect", the purpose of which is to build up a url to redirect the browser to based on the connection data.  It seems like this context (use case) has one role, whatever I might call the "connection" dumb data object.

Am I missing something or is a single role valid?

Andreas Söderlund

unread,
Oct 15, 2016, 12:55:21 AM10/15/16
to object-co...@googlegroups.com
Hi Chris, I don't think any user or stakeholder finds any value in GetAuthorizationRedirect, so I wouldn't call it a use case. Business value is central in those.

As you say, with no collaboration you hardly have a Context. What you describe sounds simple enough to be a function, especially if the data required is contained in a single object.

Maybe you want to create a low-level Context anyway as an exercise, then the mental model should be based on the programmers explanations. Based on your description there could be some interaction between the connection and the oauth provider, but if they don't do anything but providing data for a url, a whole Context isn't really required.

/Andreas

--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.

James O Coplien

unread,
Oct 15, 2016, 5:27:22 AM10/15/16
to object-co...@googlegroups.com
Maybe starting with the use case can help shed some light on which direction to go.

Chris McLeod

unread,
Oct 15, 2016, 11:00:13 AM10/15/16
to object-composition
Ok i'll keep thinking more about how this fits in to the overall product and maybe this is part of a larger context.  Thank you.

Matthew Browne

unread,
Oct 15, 2016, 12:04:37 PM10/15/16
to object-co...@googlegroups.com

It might be what Cope calls a "habit" - a portion of a use case that is repeated in more than one use case. Habits can be implemented as contexts but as Andreas mentioned, this functionality might be simple enough (involving minimal interaction) that a single function might suffice. In any case, it would be best to write out some use case descriptions prior to coding - I think that's what Cope was getting at.

--
Reply all
Reply to author
Forward
0 new messages