--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
On 30 Dec 2014, at 13:50, Hai Quang Kim <wan...@gmail.com> wrote:The domain is what we was discussing in this forum.What is a DCI Context, a Role, a Role Method, a Role Interface...?And how they are related to each other...?
On 30 Dec 2014, at 14:29, Hai Quang Kim <wan...@gmail.com> wrote:So I guess my domain is not about DCI implementation but about displaying DCI context file (parse it, show it, and edit it).
Assume that I am at the step that I already have my Model,
--
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 unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
On 02 Jan 2015, at 07:18, Hai Quang Kim <wan...@gmail.com> wrote:Leslie Lamport shows us the tasks of programming:3 Tasks of Programming:1) Decide What a program should do?2) Decide how the program should do it?3) Implement these decision in code.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsubscribe@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
On 02 Jan 2015, at 07:18, Hai Quang Kim <wan...@gmail.com> wrote:Set aside the Model question, I may have it in my head but I don't know how to share it effectively yet.
--
You received this message because you are subscribed to a topic in the Google Groups "object-composition" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/object-composition/IzoIo5kFv1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to object-composition+unsub...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to object-composition+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
The initial excitement from opening a file in a new program will probably fade soon, I think. :) And then you'll need real value to keep the user happy. Opening a file won't do much by itself, the value comes from a longer process than that. Like sending an email or making a money transfer.
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "object-composition" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/object-composition/IzoIo5kFv1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
...
...
Hi Quang,
1) RegionReader reads all Region Info2) ContextReader reads Contex Info from Context Region3) UsecaseReader reads Usecase Info from Usecase Region4) RoleReader reads Role Info from Role Regions
...complete opposite from the emphasis on data that is often presented as a basic tenet of OOP, e.g.:On Tuesday, April 22, 2014 at 10:58:47 PM UTC-4, Jonah S wrote:
http://objology.blogspot.com/2011/09/one-of-best-bits-of-programming-advice.html
The odd part is that the above link attributes the advice to Russ Pencin, who apparently was one of the early OO programmers at PARC. I suspect Mr. Pencin is either being misinterpreted here, or he never fully understood the original OO vision.
One thing I will say for the advice of not naming classes ending with "er" is that it would be a mostly good rule of thumb for naming data classes; names that end with "er" are more likely to be roles.
> http://objology.blogspot.com/2011/09/one-of-best-bits-of-programming-advice.htmlWhat we were really talking about were "agentive nouns" - nouns based on verbs (which often end in "er" but of course there are exceptions).
>
> The odd part is that the above link attributes the advice to Russ Pencin, who apparently was one of the early OO programmers at PARC. I suspect Mr. Pencin is either being misinterpreted here, or he never fully understood the original OO vision.
This was actually one of Peter Coad's principles, and, paradoxically, it's intended to ensure that behavior and not data is the focus of an object. I really like this article on it:
http://www.carlopescio.com/2011/04/your-coding-conventions-are-hurting-you.html
And I don't see any inherent conflict between this view and the DCI dumb object view -- in DCI the -er principle would still apply to role names for the same reasons. I could be wrong though...
--
usecase 2:
usecase 3:
usecase 1
...
--
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.
...
On 23 Feb 2015, at 15:36, Hai Quang Kim <wan...@gmail.com> wrote:that is interesting, can you help to give an example?in the old OOP, we usually extract big function of a class into smaller class.this is a typical example of parser:
This is a correlation-causation problem. The fact that you have a high correlation of words that create poor OOP concepts does not imply that they are the cause of such a poor name. Perhaps you should take a step back and look at what you're saying *without* the emphasis on the last two letters of each word.
The 'er' suffix is not the problem with a term like Loader or Manager. It's the vagueness that is the problem. What kind of Loader? What kind of Manager? Some words are inherently vague, like "Component", which, by the way, does not end in '-er', but should also be avoided. Some other words (ending in '-er' and not) might be vague but are integral because they represent well known concepts in computer science and engineering. Parser and Compiler are obvious ones-- tacking them on the end of a class should immediately let us know what the class is for. The same goes for Controller, because it is a well known pattern. These "-er" terms convey meaning that improves the understanding of your domain model. I couldn't imagine a replacement for Controller that would convey the use of a controller pattern so obviously. Why would we throw out 20+ years of design patterns? If you cannot accept the idea that names also act as cues for the patterns we use, then you are missing an integral part of building maintainable code.
You also made no argument about qualifying these names. Yes, "Loader" itself might be vague, but is "DiskFileLoader" all that vague? If I just called a class "Factory" (doesn't end in '-er'), just /^Factory$/, I would be chastised for improperly naming the class. Yet if I qualified it, PersonFactory, this is considered almost unanimously acceptable (unless you just hate the Factory pattern), even by you in this article, it seems. What is the difference? Qualification in both cases makes an otherwise vague word into an understandable concept. This shows that '-er' has nothing to do with understandability of the name.
In short, what you've basically said is: "Don't name things vaguely". We've known this rule for a long time."
--
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
On 24 Feb 2015, at 15:46, Hai Quang Kim <wan...@gmail.com> wrote:so I guess we can inject parse method into file path string object.
I dont agree to the comment that it's the varieres that's the problem. -er classes very seldom model some actual object but almost always are an OO-fications of a procedure. It's a verb turned into a noun so that we can speak of it as it was an object but it isn't ContextFileParser isn't vague but it's not a thing/object either. It's an OO encapsulation of a procedure related to an object ie the context file. As I commented earlier I find that many -er classes are role method candidates
Let's say the main use case is "Load and Visualize DCI Context File". "ContextParser" could then be a role within the context for that use case, e.g.:
parser = new ContextParser(ContextFile); //instantiate the nested context
parser.parse();
So in summary I would say that if a role name ends in "er", it's most likely more of a procedure than an object, which means that instead of being played by a data object, it should either be a role method (rather than a role itself), or nested context (which is essentially just a bigger procedure that happens to have multiple role players involved in order to do its work). Of course there are exceptions to every rule, especially when it comes to the English language...
But why not have a function with roles (i.e. context function)?
context = parseContext(ContextFile)
If an object has a single method, it probably should be a function.I would think that the same applies to context objects.
+ Egon
On 25 Feb 2015, at 11:13, Hai Quang Kim <wan...@gmail.com> wrote:That is true.My first feeling for that ContextParser is simple:Usage:Parser.Parse(filePath, out ContextFileModel)Implementation:static class Parser{public:void Parse(string path, out ContextFileModel)private:all of the sub-methods are here.}
You are right that I am trying to learn DCI and try to see if I can break that procedural class (1 API) into something interesting like interaction of Role(s)
To learn DCI I suggest starting with more straightforward examples.
yep, I will revisit all of the examples after trying different things.
especially the Dijkstra algorithm example.
as far as I remember procedural programming was doing good for it.
I will redo it with DCI and compare the 2 versions to see what is the difference.
--
You received this message because you are subscribed to a topic in the Google Groups "object-composition" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/object-composition/IzoIo5kFv1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to object-composition+unsub...@googlegroups.com.