Re: [Isogest-project] Template?
IGSuite is a web-ajax-based Integrated Groupware Suite
Brought to you by:
ale_forlani,
lucas73
From: Ortolani D. <d.o...@ec...> - 2005-01-19 10:51:13
|
Ciao Michele,=20=20 =20=20 > Io sono uno degli interessati.=20=20 sei sempre il benvenuto.. (e lo sai ;)=20=20 =20=20 Premetto che sin dagli inizi ho combattuto con e-mail che criticavano il ma= ncato=20=20 uso da parte mia di un sistema di Templating. La mia posizione al riguardo,= =E8 che=20=20 considero l'uso di un Framework che definisce GUI o comunque "strumenti gra= fici",=20=20 una soluzione altrettanto valida a quella di un sistema di templating.=20= =20 Detto questo, chiaramente sia l'una che l'altra soluzione, hanno a parer mi= o pregi e=20=20 difetti differenti, che sono ben contento di analizzare insieme.=20=20 =20=20 In primis chi tifa per i template lo fa in virt=F9 di una delle caratterist= iche=20=20 principali che un buon software deve avere, e cio=E8 la divisione di tutto = ci=F2 che =E8=20=20 "logica/elaborazione" da quello che =E8 "presentazione". Ma non solo con i = template si=20=20 ottiene questa divisione. Se io riesco a definire un FrameWork (come ho fat= to in IG)=20=20 che offre degli strumenti ben definiti, la mia applicazione sar=E0 composta= da una=20=20 parte dal codice che definisce il Framework (che conterr=E0 i print dell'ht= ml) e una=20=20 parte (che =E8 poi la maggior parte del codice) che definisce la logica di= =20 funzionamento dell'applicazione e si avvale del framework per la presentazi= one.=20 Ecco quindi che sussiste allo stesso modo dei template una divisione tra lo= gica e=20 presentazione.=20=20 =20=20 > A tal proposito, vorrei aprire una discussione sulla gestione del codice= =20=20=20 > HTML per quanto riguarda le pagine web generate da Isogest. Al momento=20= =20=20 > l'HTML viene direttamente stampato da Perl utilizzando print(), il che=20= =20=20 > non va in s=C3=A9 male ma mi pare una soluzione poco flessibile.=20=20 =20=20 Chiaramente i template offrono pi=F9 flessibilit=E0 da un punto di vista gr= afico e di=20=20 elaborazione della presentazione, ma a parer mio tale flessibilit=E0 =E8 la= stessa per=20=20 quel che riguarda la logica all'interno dell'applicazione. C'=E8 poi da dir= e che a=20 volte il rimanegiamento di Template non risolve alcune necessit=E0 di prese= ntazione.=20 Tanto per citare un esempio, ultimente ho definito un nuovo skin di IG adat= to per=20 essere visualizzato su palmari. Tale skin non solo altera la presentazione = ma anche=20 la logica di funzionamento di alcuni widget. In una situazione analoga con = l'uso di=20 Template non so se avrei avuto la stessa flessibilit=E0 che ho avuto per ri= solvere il=20 problema.=20 =20=20 > Un sistema basato sui template permetterebbe una gestione completamente= =20=20=20 > indipendente del codice HTML, portando principalmente a due vantaggi:=20= =20 >=20=20=20 > - codice Perl di Isogest molto pi=C3=B9 pulito (e questo =C3=A8 secondo m= e un=20=20=20 > vantaggio *enorme*)=20=20 =20=20 non sono daccordo, il codice =E8 assolutamente pulito! ti invito a guardare= il=20=20 sorgente di questo script http://www.isogest.org/cgi-bin/framework in esso = =E8=20=20 presente la sua logica (mostra le potenzialit=E0 del Framework di IG), ma n= on troverai=20=20 manco un pezzetto di html. Ho scritto quel script apposta per far capire il= =20=20 funzionamento del FrameWork di IG.=20=20 =20=20 > - possibilit=C3=A0 di controllare finemente ed in maniera abbastanza faci= le=20=20=20 > (in alcuni casi persino utilizzando editor visuali) il layout delle=20=20= =20 > pagine web. Questo =C3=A8 certamente comodo per i (pochi secondo me) uten= ti=20=20=20 > vogliono customizzare il look ad di l=C3=A0 dell'utilizzo degli skin, ma= =20=20=20 > soprattutto per gli sviluppatori, che possono editare dell'HTML puro=20= =20=20 > anzich=C3=A9 ricercarlo (ed andare pi=C3=B9 o meno a tentativi ;-)) all'i= nterno di=20=20=20 > codice Perl.=20=20 =20=20 Questo =E8 chiaramente uno degli ENORMI vantagi di una soluzione del genere= . Di contro=20=20 quindi ti rispondo con lo svantagio che ne deriva. Utilizzare un sistema di= template=20=20 pesa da un punto di vista delle prestazioni molto di pi=F9 di un sistema a = FrameWork=20=20 (se cos=EC lo possiamo definire :) ogni pagina deve subire un parsing che= =20=20 inevitabilmente appesantisce i tempi di risposta.=20=20 =20=20 Spero di non essere malinteso. Ripeto che la soluzione di un sistema di tem= plating=20=20 E' UNA SOLUZIONE PIU' CHE VALIDA. Ma a parer mio lo =E8 altrettanto un sist= ema a=20=20 Framework.=20=20 =20=20 > Chiaramente bisognerebbe far s=C3=AC che il sistema di templating sia qua= nto=20=20=20 > pi=C3=B9 portabile possibile. Visto che da quanto ne so non ci sono=20=20= =20 > core-modules sufficientemente evoluti per quanto riguarda il templating,= =20=20=20 > probabilmente bisognerebbe scegliere una soluzione Pure Perl (ed=20=20=20 > eventualmente includere direttamente il modulo nella distribuzione di=20= =20=20 > Isogest, per continuare a mantenere l'installazione estramamente=20=20=20 > facile). Tra gli altri, mi viene in mente quello che uso io (Petal), che= =20=20=20 > tra l'altro ha un meccanismo automatico di caching sia in memoria=20=20= =20 > (ottimo se si utilizza mod_perl) che su disco (in /tmp, perfetto se si=20= =20=20 > utilizza Isogest via CGI); questo permetterebbe senz'altro quasi di=20=20= =20 > annullare il gap di prestazioni esistente tra un sistema di templating=20= =20=20 > in C compilato ed uno Pure Perl.=20=20 =20=20 Qui ti trovo assolutamente concorde con le mie idee. La versatilit=E0 la po= rtabilit=E0=20=20 la facilit=E0 di installazione e le prestazioni vengono prima di ogni altra= cosa. IG=20 oggi funziona su Win e su Linux si vede bene su tutti i Browser funziona si= a su=20 Mysql che PG ed =E8 veloce (senza considerare quando gira in mod_perl). Una= eventuale=20 scelta di un sistema a templating andrebbe fatta senza dubbio in virt=F9 de= i requisiti=20 citati.=20 =20 Sinceramente non ho mai visionato Petal e mi ha incuriosito soprattutto il = fatto che=20 =E8 in PurePerl ci dar=F2 un occhiata oggi stesso.=20 =20=20 > Bene, per ora basta. Attendo obiezioni ed idee. ;-)=20=20 >=20=20=20 > Mandi, Michele.=20=20 =20 sufficenti? non credo ;)=20 =20 Saluti=20 [LucaS]=20 www.isogest.org=20 --------------------------------------------------------=20=20 |