[Pharo-users] Questions about NewValueHolder and Model
Hi everyone! I was trying to find out how to propagate changes through widgets in the Spec UI framework, and so far it seems to me that using NewValueHolder objects is the most proper way right now. Am I wrong? However I have some questions regarding this class: (BTW I am using a Pharo 7 image) First, you may notice that NewValueHolder extends the Model class, whose class comment simply says "Provides optimized model support". The first thing I thought coming from a non-Smalltalk background was like "What is that supposed to mean?". Then I tried to make sense of it, but you know, this has been hard because Model has a lot of methods that aren't too related IMHO. For instance let's take all the methods under the 'stepping' and 'stepping-window' protocols ...what are they intended to do? After doing some research I think they are some kind of mechanism from the Morphic framework to setup actions that will be performed periodically, probably for supporting animations or something, but what does this have to do with being a Model anyway? All of this has been pretty confusing, but I think I've understood it better after reading this post about Smalltalk MVC: http://peter.michaux.ca/articles/smalltalk-mvc-translated-to-javascript . I know this may be a bit obvious for veteran Smalltalkers, but now it has become clearer to me that this Model class is the M of the MVC framework that was used in ye olden days to build Smalltalk UIs. Which is weird because as far as I know MVC doesn't exist in Pharo. So I asked myself: "Shouldn't this be killed? Why is it kept? (at least it should be cleaned up I think)". And after searching the references and senders of the methods I think it mostly comes down to Morphs. Is it feasible to clean this up? I think all of this should be explicitely documented at least, you know, all this Model API. Currently it's too implicit, not friendly for newcomers and too mixed up with random Morphic stuff (which should be dying soon anyway). Some other thing that bothers me it's that that most of the methods in Model are defined in Object too. I understand that that was made in the original MVC to have the ability to use anything as a Model, but I don't think that's necessarily the best option. It would be cleaner perhaps to have an asModel message which creates a ProxyModel object which implements all the Model API methods and then proxies the rest to the underlying instance; or maybe a more pragmatic approach would be like moving all these Model methods in object to an extension protocol; or ...hey, it's 2018! Today we have traits, we could create a Trait with all those methods and then just let the current Model class use it. That's are my thoughts about the Model class. Now I'm not an expert, so they should be taken with a grain of salt ;) Coming back to the NewValueHolder, other two issues came to my mind: - What's the deal with the old ValueHolder class? Apparently it's not used anywhere. I think it should be removed, and NewValueHolder should be renamed to ValueHolder. - Some messages of NewValueHolder are also in the Model class in the 'announcing' protocol... What's the point of this polymorphism? This is not like the classical Model API at all, which uses the dependents and updating protocols. All these methods under the 'announcing' protocol use a totally unrelated way of propagating changes. This breaks SRP, shouldn't we have instead like a NewModel class which uses this new Announcement-based mechanism for propagating changes and don't conflate the two things? - In the same fashion, I don't think there isn't any good reason for having the NewValueHolder as a Model subclass; at least the Model that implements the behavior from the old MVC framework. For the record in my image I've done 'Object subclass: #NewValueHolder (...)', copied all the announcing methods to NewValueHolder and added an announcer instance variable and it's going fine so far, but that might be because all Objects can be used as models in the MVC sense. Anyway, after some use 'Object classVariableNamed: #DependentsFields' still prints "#DependentsFields->a WeakIdentityKeyDictionary()" :P I think that's it, or maybe I forgot something I don't know haha -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Re: [Pharo-users] Questions
And there is this chapter in the new book: https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/NeoCSV/NeoCSV.html But I understood that Alejandro has to write a simple CSV parser from first principles himself. > On 28 Jul 2016, at 09:51, Julien Delplanquewrote: > > Hello, > > Have a look at "NeoCSV" project from the catalog browser. > > This document [1] may help you as well. There is a dedicated section for > NeoCSV. > > Regards, > Julien > > Links: > [1]: > http://www.slideshare.net/philippeback/pharo-days-2016-data-formats-and-protocols > > > On 28/07/16 08:30, Alejandro Adgi Romano wrote: >> Hello, my name is Alejandro. >> >> I´m writting code in Pharo 5.0. >> >> I need finish an exercise of my career. >> >> My question is: >> >> ¿Could you tell me how can read and write a CSV File? >> >> I need the code, because i don´t understand how is the use of NeoCSV or >> another tool for this. >> >> In the exercise, the text says: >> "You must Show the CashFlow por One Period with information from >> CashFlow.csv" >> >> >> ¿How can I do this? >> >> Thanks!!! >> > >
Re: [Pharo-users] Questions
Hello, Have a look at "NeoCSV" project from the catalog browser. This document [1] may help you as well. There is a dedicated section for NeoCSV. Regards, Julien Links: [1]: http://www.slideshare.net/philippeback/pharo-days-2016-data-formats-and-protocols On 28/07/16 08:30, Alejandro Adgi Romano wrote: Hello, my name is Alejandro. I´m writting code in Pharo 5.0. I need finish an exercise of my career. My question is: ¿Could you tell me how can read and write a CSV File? I need the code, because i don´t understand how is the use of NeoCSV or another tool for this. In the exercise, the text says: "You must Show the CashFlow por One Period with information from CashFlow.csv" ¿How can I do this? Thanks!!!
[Pharo-users] Questions
Hello, my name is Alejandro. I´m writting code in Pharo 5.0. I need finish an exercise of my career. My question is: ¿Could you tell me how can read and write a CSV File? I need the code, because i don´t understand how is the use of NeoCSV or another tool for this. In the exercise, the text says: "You must Show the CashFlow por One Period with information from CashFlow.csv" ¿How can I do this? Thanks!!!
Re: [Pharo-users] Questions about MetaLink
For instance, in order to address a layer with no MetaObjects execution, a layer with MetaObjects for logging or breakpoints, an other layer with custom MetaObjects, etc. I don't see how it would be possible to limit the scope of the active layers configuration, just for a block evaluation for exemple... From RFMetaContext maybe, but how ?… One thing I want to add is to make the condition (optionally) into an object and then allow reflectivitly to turn on/of links without having to actually change the #condition: itself. This is now in Pharo5… links can be turned on/off reflectively by using #enable and #disable. I works by wrapping the original condition into a RFCondition object. #disable puts just “false” as the outer condition, but one could put there more complex conditions, too Marcus
Re: [Pharo-users] Questions about MetaLink
On 29 Apr 2015, at 22:59, Glenn Cavarlé gl...@cavarle.fr wrote: Hi, I'm playing with Slots and MethodWrappers to customize instVar reading/writing and method calls. In my experiments, Slots and MethodWrappers hold meta-description objects used at runtime to apply some filters, validations and to compose or delegate methods behavior. Interesting! I'm really interested in the progress of MetaLink, I saw that it will be possible to use hooks like #instead or #arround. Are these hooks can replace the use of MethodWappers ? Yes! Will it be possible to call a MetaObject's method instead of a method's body and with the passed arguments ? Yes, this will work very soon… in a simple version (only one replace link allowed). (Later this will be generalized AOP style as an #around with the possibility to “proceed” to the replaced node). What I am porting now from the prototypes is the functionality to hand arguments over to meta objects. before links on methods are already working: link := MetaLink new metaObject: [ self halt ]. (ReflectivityExamples#exampleMethod) ast link: link. execute it: ReflectivityExamples new exampleMethod. (ReflectivityExamples#exampleMethod) symbolic '21 20 pushConstant: [ self halt ] 22 C9 send: value 23 77 pushConstant: 2 24 21 pushConstant: 3 25 B0 send: + 26 7C returnTop’ (This example, too, shows that a block can be a meta object, this means that this can be used as a very easy to use instrumentation framework, too, without the need to create explicit classes and methods for meta objects). The announcement of meta-levels gives me ideas, would not it be interesting to have something like meta-layers? Yes! For instance, in order to address a layer with no MetaObjects execution, a layer with MetaObjects for logging or breakpoints, an other layer with custom MetaObjects, etc. I don't see how it would be possible to limit the scope of the active layers configuration, just for a block evaluation for exemple... From RFMetaContext maybe, but how ?… One thing I want to add is to make the condition (optionally) into an object and then allow reflectivitly to turn on/of links without having to actually change the #condition: itself. Then links themselves could target these control meta objects… It is definitly interesting. E.g. one might want to have break points active, yet run the tests with them disabled. Marcus
[Pharo-users] Questions about MetaLink
Hi, I'm playing with Slots and MethodWrappers to customize instVar reading/writing and method calls. In my experiments, Slots and MethodWrappers hold meta-description objects used at runtime to apply some filters, validations and to compose or delegate methods behavior. I'm really interested in the progress of MetaLink, I saw that it will be possible to use hooks like #instead or #arround. Are these hooks can replace the use of MethodWappers ? Will it be possible to call a MetaObject's method instead of a method's body and with the passed arguments ? The announcement of meta-levels gives me ideas, would not it be interesting to have something like meta-layers? For instance, in order to address a layer with no MetaObjects execution, a layer with MetaObjects for logging or breakpoints, an other layer with custom MetaObjects, etc. I don't see how it would be possible to limit the scope of the active layers configuration, just for a block evaluation for exemple... From RFMetaContext maybe, but how ?... It is just an idea on the fly, Maybe it's already possible to do something like that or it would be just useless in practice. Thanks a lot Marcus for your work on Slot and MetaLink. Best regards, Glenn. - Glenn Cavarlé -- View this message in context: http://forum.world.st/Questions-about-MetaLink-tp4823035.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Re: [Pharo-users] Questions about Magma
Hi , @Stéphane Ducasse I will definitely give mango DB a try. I was using GLORP since a very long time (not in pharo) so when i looked at magma i got interested. So all other options stayed back for later in my list. @Stuart Herring The changes as far as i know is related to SystemAnnouncer , FileReference and the vm parameterAt: . So what i plan to do is to load all the latest stuff a from ss3.gemstone.com/ss/MaBase Ma-Client-Server Magama , make the changes and run the tests , with *MagmaTestCase fullSuite maDebug* Hopefully i may get some bugs which i can fix...else i will be contacting the author. I hope Chriss muller will be reading this...and correcting me if i wrote something wrong. Thanks to all. Thushar thuchu On Wed, Jun 5, 2013 at 5:30 AM, Stuart Herring st-li...@stuartherring.comwrote: Hi Thushar, Magma's developer mostly uses Squeak, so the latest version of Pharo that Magma works more or less out-of-the-box on is 1.3. I made a start on porting it to 1.4, and then 2.0 but then promptly ran out of time. However, as far as I'm aware the porting should mostly consist of the change to SystemAnnouncer, and Filesystem as you mentioned. Magma has a pretty comprehensive test suite, so it should be relatively easy to verify any porting effort. I know that people seem to be gravitating towards other solutions, as Stéphane mentioned, but Magma is still an excellent tool, and is ridiculously simple to use. I like it enough that for my own projects, I'm still using Pharo 1.3 so I can use it, until the desire to use 2.0 and beyond finally pushes me into completing my porting effort ;) If you do want to give the porting a go yourself, I'd suggest posting to the Magma list. Chris is very supportive of porting efforts. Regards, Stuart On 4 June 2013 22:32, Thushar G R thushar...@gmail.com wrote: Hi all, I am new here in this list. I have already asked this question in stack overflow, but not much luck. So i thought ill contact the gurus directly. I am considering Magma to be used for one of my projects , which is nothing but a custom game center to connect my game and store user details and retrieve it. This would be the first time that i will be using pharo for one of my projects ( in fact this is the first time that i am able to decide for my self - the client has not preferences in terms of technology selection). So my concern is this, is Magama upgraded to be used in Pharo 2.0? What if i load it and change the SystemChangeNotifiers with SystemAnnouncer and so on , will it cause any trouble in the future. I Appreciate any comments for this. Regards thushar
[Pharo-users] Questions about Magma
Hi all, I am new here in this list. I have already asked this question in stack overflow, but not much luck. So i thought ill contact the gurus directly. I am considering Magma to be used for one of my projects , which is nothing but a custom game center to connect my game and store user details and retrieve it. This would be the first time that i will be using pharo for one of my projects ( in fact this is the first time that i am able to decide for my self - the client has not preferences in terms of technology selection). So my concern is this, is Magama upgraded to be used in Pharo 2.0? What if i load it and change the SystemChangeNotifiers with SystemAnnouncer and so on , will it cause any trouble in the future. I Appreciate any comments for this. Regards thushar
Re: [Pharo-users] Questions about Magma
Excellent. We would really like to have magma running on Pharo. Please push Stef Hi Thushar, Magma's developer mostly uses Squeak, so the latest version of Pharo that Magma works more or less out-of-the-box on is 1.3. I made a start on porting it to 1.4, and then 2.0 but then promptly ran out of time. However, as far as I'm aware the porting should mostly consist of the change to SystemAnnouncer, and Filesystem as you mentioned. Magma has a pretty comprehensive test suite, so it should be relatively easy to verify any porting effort. I know that people seem to be gravitating towards other solutions, as Stéphane mentioned, but Magma is still an excellent tool, and is ridiculously simple to use. I like it enough that for my own projects, I'm still using Pharo 1.3 so I can use it, until the desire to use 2.0 and beyond finally pushes me into completing my porting effort ;) If you do want to give the porting a go yourself, I'd suggest posting to the Magma list. Chris is very supportive of porting efforts. Regards, Stuart On 4 June 2013 22:32, Thushar G R thushar...@gmail.com wrote: Hi all, I am new here in this list. I have already asked this question in stack overflow, but not much luck. So i thought ill contact the gurus directly. I am considering Magma to be used for one of my projects , which is nothing but a custom game center to connect my game and store user details and retrieve it. This would be the first time that i will be using pharo for one of my projects ( in fact this is the first time that i am able to decide for my self - the client has not preferences in terms of technology selection). So my concern is this, is Magama upgraded to be used in Pharo 2.0? What if i load it and change the SystemChangeNotifiers with SystemAnnouncer and so on , will it cause any trouble in the future. I Appreciate any comments for this. Regards thushar