Live data from Hacker News

Show HN: UML model and code examples of GoF patterns in Crystal

github.com

11–19 of 19 posts

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#11
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

The only pattern I regularly use is the Visitor pattern, which is very common in compilers these days. It's productive, but I'm still slightly worried when I use it because it seems to encourage relatively stateful code that doesn't compose properly. Writing a new visitor takes a while, so people also put too much in one visitor.

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#12
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

Yes, sequence, flux and class diagrams, all the time.

I rather do whiteboard UML than throw away code that costs money and no one is going to use.

ER for database modelling.

Same applies to UIs, Balsamiq with paper simulations, and click dummies, until everyone agrees what the GUI workflow should actually be like.

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#13
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

Using UML implies that someone is planning development more then a week ahead, be agile man, no plans, no docs and no time for unit tests.

What has unit testing to do with UML?

Also, most unit tests are a waste, outside of library code (and I’d venture in most library code the majority of unit testing is duplicative, or otherwise unnecessary). Prefer integration tests.

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#14
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

Apparently JPL uses Model Driven Development to build telescopes. There is an interesting presentation[0] which describes their setup to design and build the JPL Thirty Meter Telescope. They use SysML[1] and Jupyter to provide true model driven development, i.e., changes to models are propagated to the code.

[0]=https://www.youtube.com/watch?v=CshfBGrjdBU [1]=https://en.wikipedia.org/wiki/Systems_Modeling_Language

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#15
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

I generate them automatically from intellij otherwise it wouldn't be worth it. The UML notation is easily cryptic to the neophyte but it can sometimes help to give an overview.

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#16

Great stuff - I love the map: https://raw.githubusercontent.com/takaakit/design-pattern-ex...

Ya, that's pretty terrific. Having the diagrams paired with the code is a boon. My GoF study group (of mostly Java and C++ devs) spent way too much time divining how to "realize" (something short of implementation) the design patterns. I wish we had the SmallTalk version of these graphs.

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#17
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

Apparently JPL uses Model Driven Development to build telescopes. There is an interesting presentation[0] which describes their setup to design and build the JPL Thirty Meter Telescope. They use SysML[1] and Jupyter to provide true model driven development, i.e., changes to models are propagated to the code. [0]= https://www.youtube.com/watch?v=CshfBGrjdBU [1]= https://en.wikipedia.org/wiki/Systems_Modeling_Language

Will watch, thanks. That was the Holy Grail, back when I cared about these things. So much time wasted with tools like Rational Rose et al. It'd be very satisfying if it's finally feasible, or better.

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#18
post #11
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

The only pattern I regularly use is the Visitor pattern, which is very common in compilers these days. It's productive, but I'm still slightly worried when I use it because it seems to encourage relatively stateful code that doesn't compose properly. Writing a new visitor takes a while, so people also put too much in one visitor.

Tangent: Over time I migrated to favoring Iterator over Visitor. Similarly, using event model with Command objects instead of Observable. YMMV, of course. Both require seeing problems thru a different prism.

Re: Show HN: UML model and code examples of GoF patterns in Crystal

#19
post #7
post #3

During its heyday I was an active supporter of UML. Nowadays, I hardly ever hear of it. Does anybody use it any more?

Last year, I used the UML static object modeling notation for understanding and documenting an existing RDBMS schema. Also last year, I used some of the UML state modeling (or Harel Statecharts) for getting the UI right for a SwiftUI app. Earlier this year, I used DeMarco-Yourdon DFDs (but we can call it UML) for business process modeling. (And our director of marketing picked it up instantly, and even had an insight…

> One thing to know about these system analysis&design methodologies...

It's crazy think about now, but the methodology strongly influences the design.

Late 90s, I favored the Fusion Methodology for design. There was a researcher in the UK (Tony something?) that showed using the UML process led to overuse of Observable (Listener), which quickly becomes intractable. Tony (?) then reimplemented the same problems with Fusion, then diffing the resulting implementations.

The notion is almost lost in the sands of time. I'm pretty sure this is the same Fusion. I couldn't quickly refind Tony's (?) original work.

http://wiki.c2.com/?FusionMethodology

The diagrams and other artifacts were largely the same.

> ... only a fraction of the benefit

Emphatic agreement.

Alas, I've never worked at orgs that would or could keep the modeling and the implementation in sync. Perhaps it's more feasible now. (I haven't looked for a long time.)

Post reply on HN