Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If you don't know cohesion, you might be a crappy coder
Message
From
31/05/2021 01:48:48
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/05/2021 20:14:49
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01680834
Message ID:
01680846
Views:
54
>>>At assemble time - in the kettle production line - they work with physical modules - they don't need the blueprints. Likewise in code, we can ship external modules that will be combined when needed at execution time. That is a godlike power only programmers have, and few ever seem to use it.
>>
>>I'm not sure cohesion is the right term. Adhesion means "sticks to other things", cohesion then means "sticks to itself". Which means in this case cohesion is bad, you don't want your class to contain everything it may need - you want it to reuse parts already available. Where we spell reuse all uppercase until the apprentice turns blue in the face.
>
>Wrong. https://en.wikipedia.org/wiki/Cohesion_(computer_science)

Sorry to burst your bubble, but the definition there still makes more sense than your kettles example. And I still think the expression is somehow wrong, but taken as a measure it's sort of okay. Is it a replacement for encapsulation or a way to measure it? Hmmmm....

>A thing must be internally cohesive.

Sure. Because externally cohesive is called adhesive, aka sticky.

>It must have loose connections to other things. Even if all of those things make for a single thing, it still has nothing to do with where the blueprints are stored at design time.

The storage is completely irrelevant. The famous OOP question "where does the code go?" is not about files, it's about logic, "which object's job is this?".

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform