![PawCast with GeePaw Hill artwork](https://is4-ssl.mzstatic.com/image/thumb/Podcasts123/v4/f7/6a/bc/f76abc91-b6f4-eb95-39f5-ecae7658350c/mza_2663806889298342520.jpg/100x100bb.jpg)
Refactoring: Demeter-Wrapping | #52
PawCast with GeePaw Hill
English - May 05, 2020 09:00 - 7 minutes - 13.9 MB - ★★★★★ - 6 ratingsTechnology Homepage Download Apple Podcasts Google Podcasts Overcast Castro Pocket Casts RSS feed
Demeter violations are places where a client accesses not just an upstream service, but that service's upstream services, or even that service's service's upstream services. It's a common problem in evolving code, and left untended, a classic source of unchangeable code. Demeter calls look this: a.getB().getC().doSomething(). a is getting a B, but is using that B expressly to get a C, then finally calling some method on the C to do something. (The getX()'s could as easily be exposed fields rather than methods: depends on idiom & language.) I want to stave off some potential confusion. 1) You might be used to thinking that any chain of '.'s like these is just "fluent". 2) You might, alternatively, be thinking that any chain of '.'s like these is inherently evil. Neither of these assumptions is necessarily valid.
---
You can read the full transcription of this podcast over on GeePawHill.org. Any feedback, you can always tweet @GeePawHill on Twitter, or drop a voice message via the voice messages link here on Anchor. If you are interested in becoming more involved in the Change-Harvesting community, click here to learn about GeePaw's Camerata.
---
Send in a voice message: https://podcasters.spotify.com/pod/show/geepawhill/message