Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Software Architecture - Coupling and Cohesion
Message
From
30/04/2004 18:22:59
 
 
To
30/04/2004 05:34:54
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00899040
Message ID:
00899952
Views:
27
Mike-

>Modules/procedures can all be components. This is not just an OOP discussion.

Fair enough. I see your point.
*snipped*

>DWORD.PRG is cohesive. If I copy the code from DWORD.PRG into a method of a class that extracts icons and deletes DWORD.PRG, that method is cohesive. The class is cohesive, because its members (methods) are supporting the responsibility of the component.

Okay.

>A class that holds a bunch of generic functions would not be cohesive. Further, it would likely require more coupling.

Okay.

*snipped*

>I think we're saying very similar things except that I said meaning and you said responsibility.

Okay.

*snipped*

>I don't see why these concepts cannot be applied to functions/prgs etc.
>
>>I think this would be a good candidate for an interface. And you could implement this method as a DWORD interface. What do you think about that idea?

Let me come back to the above...

>So is putting the code from DWORD into each class that needs it _tight_ coupling and therefore wrong?

I don't think you're dealing with issues of coupling or cohesion at all, except indirectly as a byproduct of where you put this functionality. Would you agree?

I don't know what heading I'd stuff it under, but basically you have a snippet of code that you want to reuse, yes? And you want it to be lightweight enough that clients of the code can use it w/o getting a lot of other baggage.

You're right it should be in one place and one place only. Oh, sheesh. Now I would have to go back to the first post, though I'll lose my place. What the heck was wrong with making this an object that you instantiate, it returns the dword, then poof! it's gone and done. IIRC, your original post had an extension that seemed to me to be artificial.

BTW, what about the idea of using an interface?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform