Re: [WebDNA] maybe silly suggestion? [founditems]

This WebDNA talk-list message is from

2015


It keeps the original formatting.
numero = 111927
interpreted = N
texte = --54b831f0_41b71efb_12a Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sure, that=E2=80=99s one aspect of it. It=E2=80=99s mostly about keeping things modular and reusable, and keepin= g to general MVC patterns. =46or those unclear on the concept: =E2=80=A2 M =3D Model - generally the database storage, including code th= at understands the meanings of the fields and the relationships between d= atabases =E2=80=A2 V =3D View - the HTML code that presents your content to the us= er =E2=80=A2 C =3D Controller - the logic that processes and validates form = variables, executes user actions and decides what (not how) needs to be s= hown to the user Commonly I keep the bulk of my controller code at the top of a page, the = model code in external function libraries that can be reused by many page= s, and the view code at the end of a page. Where it makes sense, I try to= keep view code out of my controller, and control code out of my view. There are reasonably frequent occasions where I=E2=80=99m working on the = View code and I think =E2=80=9Chey, I did this search at the top of the p= age, it would be nice not to duplicate efforts=E2=80=9D, but I would rath= er not leave dangling open search contexts from my controller open throug= hout the page. It=E2=80=99s a stylistic choice that can be done with current tools, but = could be done with significantly less code, simpler syntax, and better pe= rformance if I could save search results (the data not the presentation) = with a built-in tag and re-access it later in the page - or in separate g= eneral-use function libraries that don=E2=80=99t need to be aware of the = details of the page being built. Also, for clarification, it was the other Brian (Burton - or maybe I=E2=80= =99m the other Brian) who presented the concept originally. I=E2=80=99ve = just been running wild with delusions of grandeur. =E2=80=94 Brian =46ries On January 15, 2015 at 12:38:57 PM, Kenneth Grome (ken=40webdnasolutions.= com) wrote: =46rom what I understand, Brian wants his founditems contexts to =20 work outside his search context, but because this is not the way =20 WebDNA works he wants new tags/contexts to implement it. =20 Is this correct Brian=3F =20 Regards, =20 Kenneth Grome =20 WebDNA Solutions =20 http://www.webdnasolutions.com =20 Web Database Systems and Linux Server Management =20 On 01/15/2015 02:20 PM, Dan Strong wrote: =20 > Gotta admit that I agree with Ken and have from the start. I am =20 > not seeing the value of this either, but maybe I just don't =22get =20 > it=22 either. =20 > =20 > Also looking forward to a concrete use case/example to help me =20 > understand the concept a bit better. =20 > =20 > -Dan Strong =20 > http://DanStrong.com =20 > =20 > On Thu, Jan 15, 2015 at 12:10 PM, Kenneth Grome =20 > > wrote: =20 > =20 > > =5Blistfounditems=5D would have access to all the fields in the =20 > > database that was searched =20 > =20 > Are you suggesting that =5Blistfounditems=5D cache the results of the =20 > original search=3F If so, this means that each time the page is =20 > requested WebDNA must cache a new copy of the founditems data, =20 > correct=3F =20 > =20 > And how this data going to be formatted=3F OR is this new context =20 > there simply to allow you to use =5Bfieldname=5D tags -- which we can =20 > already do in our =5Bfounditems=5D contexts=3F =20 > =20 > =20 > =20 > > You could reuse the found item set multiple times in you page =20 > > without the expensive search. =20 > =20 > I'm not sure why do you use the term =22expensive=22 here ... =20 > =20 > If you're currently using more than one identical search per page =20 > you're not doing it very efficiently. The better way is to do one =20 > search and then use several founditems contexts within that one =20 > search context. =20 > =20 > I do this all the time. I put several founditems context inside =20 > my search, then I format the results of each founditems the way I =20 > need it to be displayed further on down the page. Then I save the =20 > formatted results of each founditems as a text variable, which =20 > means I can display the entire formatted results with a simple =20 > text tag like =5Bresults1=5D. =20 > =20 > This means I'm doing only one search on the page -- and one search =20 > is certainly not =22expensive=22 from my perspective. =20 > =20 > =20 > > You could have multiple found item sets for the same database =20 > > without the potential confusion caused by nested searches =20 > =20 > I almost never do nested searches anyways since there are better =20 > ways most of the time. =20 > =20 > =20 > > The search code would not need to know anything about what the =20 > > display code will be doing with the results =20 > =20 > This is nothing different that what we already have with =20 > =5Bfounditems=5D, is it=3F If so, how is it different=3F =20 > =20 > =20 > > Built into the WebDNA engine, this could be much more efficient =20 > > than creating a set of functions to implement similar features =20 > =20 > Yet if we do not need these capabilities -- because we already =20 > have them -- we do not need to use functions, and we do not need =20 > to further complicate the engine code either, correct=3F =20 > =20 > =20 > > In my mind, features should be added to WebDNA if and only if they =20 > > add value that cannot be easily and efficiently implemented using =20 > > functions. I think this qualifies. =20 > =20 > Sorry, I still disagree. I have yet to see anything you've =20 > described or shown me that I cannot do right now with =5Bfounditems=5D = =20 > and =5Btext=5D. =20 > =20 > I'm not trying to be difficult but I truly see no advantage in any =20 > of this. =20 > =20 > Can you show me a concrete example where using multiple founditems =20 > and text vars won't do everything you're suggesting=3F Because so =20 > far I still don't get it. =20 > =20 > Regards, =20 > Kenneth Grome =20 > WebDNA Solutions =20 > http://www.webdnasolutions.com =20 > Web Database Systems and Linux Server Management =20 > =20 > =20 > --------------------------------------------------------- =20 > This message is sent to you because you are subscribed to =20 > the mailing list >. =20 > To unsubscribe, E-mail to: > =20 > archives: http://mail.webdna.us/list/talk=40webdna.us =20 > Bug Reporting: support=40webdna.us =20 > =20 > =20 > --------------------------------------------------------- This =20 > message is sent to you because you are subscribed to the mailing =20 > list . To unsubscribe, E-mail to: archives: =20 > http://mail.webdna.us/list/talk=40webdna.us Bug Reporting: =20 > support=40webdna.us =20 --------------------------------------------------------- =20 This message is sent to you because you are subscribed to =20 the mailing list . =20 To unsubscribe, E-mail to: =20 archives: http://mail.webdna.us/list/talk=40webdna.us =20 Bug Reporting: support=40webdna.us =20 --54b831f0_41b71efb_12a Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline