[Seaside] Problem showing a JPEG to the world

Jason Rogers jacaetevha at gmail.com
Thu May 26 20:31:37 CEST 2005


To follow up a little on Tony's response...

Code reuse is only as good as it is reuseable. This method is clearly not 
reuseable. So, I would agree with Tony that you do some refactoring. Before 
you do, make sure there is a test in place so that you know you aren't 
breaking anything else.

You may end up refactoring this message so that the current implementation 
is the default, but then you add another message to make it more generic. 
This is an excellent opportunity for you to dig deeper into the world of 
Smalltalk.

Some hints for the road:

   1. Alt+n (senders of this message) will show you where this message is 
   potentially being used 
   2. Alt+m (implementors of this message) may also be helpful 
   3. World Menu > Open > Method Finder (excellent for finding Methods 
   that can do XYZ given the parameters A, B, & C)
    4. Test! Test! Test! 
   5. "Branch" and work 
      1. Create a new ChangeSet and a new version of your image 
      2. do your in this new version 
      3. when you are confident you have it all working file it out 
      and then back in to your original image 
      4. if it works in the original image the way you expected and no 
      tests break, package it up and release it (perhaps as an .mcz as Tony 
      suggested)
       

On 5/26/05, seaside at fbeausoleil.ftml.net <seaside at fbeausoleil.ftml.net> 
wrote:
> Hello, Tony,
> 
> Thanks for the response.
> 
> Tony Garnock-Jones said the following on 2005-05-26 11:29:
> > Look at Form>>asMIMEDocument, which reads as follows in Seaside 2.5b3:
> >
> > asMIMEDocument
> > | aStream |
> > aStream := (RWBinaryOrTextStream on: '').
> > GIFReadWriter putForm: (self asFormOfDepth: 8)
> > onStream: aStream.
> > ^MIMEDocument contentType: 'image/gif' content: aStream contents
> 
> I found that method. Am I supposed to just change it ? I'm coming from
> the Java world, and am uncomfortable doing just that.
> 
> On the other hand, if you suggest I should copy the implementation to do
> what I want, into my own component, I thought Smalltalk was the test-bed
> of code reuse ?
> 
> Sorry for not understanding as quickly as you might think I should have.
> 
> Bye !
> François
> 
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
> 


-- 
Jason Rogers

"I am crucified with Christ: nevertheless I live; yet not I,
but Christ liveth in me: and the life which I now live in 
the flesh I live by the faith of the Son of God, who loved 
me, and gave himself for me."
Galatians 2:20
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050526/33c45fbf/attachment.htm


More information about the Seaside mailing list