1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    23
    Vote Rating
    0
    qiuyl is on a distinguished road

      0  

    Default 2-tier or N-tier on client side?

    2-tier or N-tier on client side?


    Usually we choose a 3-tier or N-tier structure for database driven website developement. With AJAX, do we need a 2-tier or N-tier on client side?

    For example, I usually use data model (DM) in js for grid, view, content panel. The js code for DM is usually mixed with other UI interface in one class. How can I effectively have a seperate class, for example datamodel class, which is exclusive for data access? In this way the DM code can be reused in many pages.

    I am a newbie in ajax application developement. All of the time I need your guys help!

    Thank you!

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    Extending the appropriate data model class always an option. Then you can add additional helper functions as well. For example:

    Code:
    FeedDataModel = function(){
         var schema = 
          ... // put your data model init and config stuff here
          // you can optionally pass paging init info to this 
          // objects constructor and call initPaging with it
    }
    YAHOO.extendX(FeedDataModel, YAHOO.ext.grid.XMLDataModel, {
        loadFeed : function(feedUrl){
            this.load('feed-proxy.php', {feed: feedUrl});
        }
    });
    then anywhere you need a new data model for feeds:

    var dm = new FeedDataModel();
    dm.loadFeed('http://www.jackslocum.com/blog/feed');

Similar Threads

  1. Client-side grid filtering (Newbie)
    By protech in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 25 Apr 2007, 8:36 AM
  2. Exploring Client-Side Cross Browser XML Data-Binding
    By genius551v in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 5 Jan 2007, 8:41 AM
  3. Server-side vs. Client-side...
    By zquirm in forum Community Discussion
    Replies: 2
    Last Post: 22 Dec 2006, 8:15 PM
  4. Yui, Client-Side SQL Query and AjaxPro for .NET
    By Choleriker in forum Community Discussion
    Replies: 9
    Last Post: 12 Dec 2006, 7:27 AM
  5. client vs server and xslt vs dom
    By Herm in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 1 Dec 2006, 12:00 PM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi