[squeak-dev] Example of Hexagonal Architecture in Smalltalk

Jakob Reschke jakres+squeak at gmail.com
Sun Jan 29 15:02:23 UTC 2023


Hi Edwin,

Since Smalltalk is dynamically typed you do not have declare beforehand
which messages a bunch of classes will understand.

In the trivial case where each class implements just one interface you
could replace a Java interface with an abstract superclass with
subclassResponsibility methods (equivalent to abstract methods in Java).
But it is not technically necessary, it also works without.

Otherwise you just need to plan, "know" or document otherwise the protocol
that the ports and adapters and the business core shall understand. Then
stick to these protocols when sending messages between them. If you get it
wrong, you will get exceptions, rather than the compiler telling you
beforehand that this object will not work if you put it into that instance
variable. Enter the usual discussions about statically typed vs dynamically
typed languages... :-)

If you find examples of hexagonal architectures for Python, or other
dynamic languages that somehow organize in classes, I assume it will be
closer to what you might do in Smalltalk.

Kind regards,
Jakob


Edwin Ancaer <eancaer at gmail.com> schrieb am So., 29. Jan. 2023, 10:31:

>
> Hello,
>
> I am looking for documentation on or an example implementation of
> Hexagonal Architecture in Smalltalk.
> I find hundreds of examples in Java, and they all use interface classes,
> but I do not find anything about interface classes in smalltalk. Maybe, due
> to the superiority of Smalltalk, they are not necessary, but I would like
> to know why.
>
> Thanks a lot ,
>
> Edwin Ancaer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230129/87216d3a/attachment.html>


More information about the Squeak-dev mailing list