Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enh]: MAMessagingStringWriter #361

Commits on Aug 16, 2024

  1. [Enh]: MAMessagingStringWriter

    Enables delegating string writing to an arbitrary object via any of its messages. 
    
    *Limitation:* cannot be used when 1) the message receiver is the container and 2) descriptions are cached e.g. when using the description for the first object in a homogeneous collection for the whole collection.
    
    Here is an example (which illustrates #1 in the limitation above and so wouldn't work with a cached description):
    
    ```
    MyDomainClass>>employeeDescription
    	<magritteDescription>
    	
    	| message writer reference |
    	message := MessageSend 
    		receiver: self
    		selector: #employeeDisplayString.
    	
    	writer := MAMessagingStringWriter new
    		messageSend: message.
    	
    	reference := MAContainer new 
    		stringWriter: writer;
    		yourself.
    
    	^ MAToOneRelationDescription new
    		reference: reference;
    		accessor: #employee;
    		yourself
    ```
    seandenigris committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    255504c View commit details
    Browse the repository at this point in the history