Thanks guys, it smelt a little whiffy to me too, but as you say that doesn't make it instantly bad... blue cheese smells bad but tastes good!
This app only deals with this one object from a webservice, so if that were to change then more would break than just the views. We don't have any control over the webservice's api or objects so we just have to hope that they don't roll out any daft changes without first letting us have access to them on the test system. As for maintenance, well that's likely to be down to me and my team of one and i guess i'm comfortable with it for as long as its not a complete PITA. Going to roll with it and see what happens Cheers, Chris 2010/1/25 Bob Silverberg <[email protected]> > I think that is very sound advice. The only thing I would add is that > you might want to consider whether having such complex code in your > view is acceptable to whoever will be maintaining the code. I often > work in an environment where I create vanilla view code which is then > handed over to a designer/CF neophyte, who might be: > a) confused by the code and > b) inclined to introduce bugs when editing the code. > > In that case it might be worthwhile creating some objects that > repackage some of the data from your object map into simple objects > that can be used by individual views. I don't think I'd put that code > in a controller, though. I'd put it in the model somewhere, such as a > view helper which Dan suggested. > > Cheers, > Bob > > On Mon, Jan 25, 2010 at 3:51 PM, Dan Wilson <[email protected]> wrote: > > To me, having such a long chain of methods in a view would smell a little > > strong. You are creating a certain knowledge of this object map in your > view > > and this can be brittle, when the object map changes. > > However, just because something smells, doesn't necessarily indicate you > > need to do something about it. Often in these cases, I write a nice long > > comment about how I am feeling about this, then leave it alone until it > > causes a problem. When there is a real problem, then I would make a > > determination about how best to sort out the problem. > > My gut instinct is that you'd be more academically correct to translate > > these deep object maps to some sort of view helper object, but you may > not > > get any real benefit from the time it would take to implement. > > I'd leave it and revisit when/if you step on your toes. > > > > DW > > > > > > On Mon, Jan 25, 2010 at 3:45 PM, Chris Blackwell <[email protected]> > wrote: > >> > >> I'm writing an application, the sole purpose of which is to update a > very > >> complex object returned from a webservice. Using the java objects > returned > >> from the webservice wasn't practical so I wrote a wsdl2cfc generator to > >> create the stub CFCs (about 150 of them) and now I'm manually > generating my > >> soap requests and deserializing it to cfc's. > >> > >> all that works surprisingly well, and now I need to start editing the > >> object, and because of it's complexity it's going to need a large number > of > >> different forms. each as it's own model glue event. > >> > >> but what I'm trying to get my head around is whether I should pass the > >> whole object to the view and let that get at the data it needs via the > >> getters or whether I should be pulling the object apart in a controller > and > >> only passing the required data to each form. > >> > >> to give you an example, to get an admin contacts postcode I'm doing > this. > >> > >> > >> > #product.getContacts().getAdminContactGroup().getDefaultContact().getAddress().getPostcode()# > >> > >> which seems like a whole lot for the view to do, but I guess there's no > >> logic here just a knowledge of structure of the object. > >> > >> the data is very highly structured so is pulling it apart and piecing > back > >> together again just pointless? > >> > >> anyone have any views on how to handle this kind of thing. > >> > >> -Chris > >> > >> -- > >> Model-Glue Sites: > >> Home Page: http://www.model-glue.com > >> Documentation: http://docs.model-glue.com > >> Bug Tracker: http://bugs.model-glue.com > >> Blog: http://www.model-glue.com/blog > >> > >> You received this message because you are subscribed to the Google > >> Groups "model-glue" group. > >> To post to this group, send email to [email protected] > >> To unsubscribe from this group, send email to > >> [email protected]<model-glue%[email protected]> > >> For more options, visit this group at > >> http://groups.google.com/group/model-glue?hl=en > > > > > > -- > > “Come to the edge, he said. They said: We are afraid. Come to the edge, > he > > said. They came. He pushed them and they flew.” > > > > Guillaume Apollinaire quotes > > > > -- > > Model-Glue Sites: > > Home Page: http://www.model-glue.com > > Documentation: http://docs.model-glue.com > > Bug Tracker: http://bugs.model-glue.com > > Blog: http://www.model-glue.com/blog > > > > You received this message because you are subscribed to the Google > > Groups "model-glue" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected]<model-glue%[email protected]> > > For more options, visit this group at > > http://groups.google.com/group/model-glue?hl=en > > > > -- > Bob Silverberg > www.silverwareconsulting.com > > Hands-on ColdFusion ORM Training @ cf.Objective() 2010 > www.ColdFusionOrmTraining.com > > -- > Model-Glue Sites: > Home Page: http://www.model-glue.com > Documentation: http://docs.model-glue.com > Bug Tracker: http://bugs.model-glue.com > Blog: http://www.model-glue.com/blog > > You received this message because you are subscribed to the Google > Groups "model-glue" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<model-glue%[email protected]> > For more options, visit this group at > http://groups.google.com/group/model-glue?hl=en > -- Model-Glue Sites: Home Page: http://www.model-glue.com Documentation: http://docs.model-glue.com Bug Tracker: http://bugs.model-glue.com Blog: http://www.model-glue.com/blog You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en
