俺一個(gè)剛?cè)腴T(mén)Meteor的小菜鳥(niǎo),硬翻了一下術(shù)語(yǔ)表剃诅,請(qǐng)各位大蝦斧正巷送。
Meteor術(shù)語(yǔ)表
集合(Collection)
A Meteor Collection is the data store that automatically synchronizes between client and server. Collections have a name (such as posts), and usually exist both on client and server. Although they behave differently, they have a common API based on Mongo's API.
Meteor集合是在客戶(hù)端和服務(wù)器端之間自動(dòng)同步的數(shù)據(jù)儲(chǔ)存。集合具有一個(gè)名稱(chēng)(例如:posts)矛辕,而且通常都存在于客戶(hù)端和服務(wù)器端笑跛。雖然它們表現(xiàn)不同,但它們都有一個(gè)基于Mongo API的通用API聊品。
迷你Mongo(MiniMongo)
The client-side collection is an in-memory data store offering a Mongo-like API. The library that supports this behaviour is called “MiniMongo”, to indicate it's a smaller version of Mongo that runs completely in memory.
客戶(hù)端集合是一種指向類(lèi)似Mongo API的內(nèi)存數(shù)據(jù)儲(chǔ)存飞蹂。支持此類(lèi)行為的代碼庫(kù)被稱(chēng)為“迷你Mongo”,這表示它是一個(gè)完全運(yùn)行于內(nèi)存的小型Mongo數(shù)據(jù)庫(kù)翻屈。
文檔(Document)
Mongo is a document-based data-store, so the objects that come out of collections are called “documents”. They are plain JavaScript objects (although they can't contain functions) with a single special property, the _id, which Meteor uses to track their properties over DDP.
Mongo是一種基于文檔的數(shù)據(jù)儲(chǔ)存陈哑,因此源自集合的對(duì)象被稱(chēng)為“文檔”。它們是帶有一個(gè)特別的 _id 屬性的簡(jiǎn)單Javascript對(duì)象(盡管它們不能包含函數(shù)),Meteor用該屬性通過(guò)DDP來(lái)跟蹤它們其他屬性惊窖。
分布式數(shù)據(jù)協(xié)議(DDP)
DDP is Meteor's Distributed Data Protocol, the wire protocol used to synchronize collections and make Method calls. DDP is intended as a generic protocol, which takes the place of HTTP for realtime applications that are data heavy.
DDP是指Meteor的分布式數(shù)據(jù)協(xié)議刽宪,該連線協(xié)議常用于同步集合并產(chǎn)生Method調(diào)用。DDP被大量數(shù)據(jù)的實(shí)時(shí)應(yīng)用程序用來(lái)作為一種替代HTTP的通用協(xié)議界酒。
客戶(hù)端(Client)
When we talk about the Client, we are referring to code running in the users web browser, whether that is a traditional browser like Firefox or Safari, or something as complex as a UIWebView in a native iPhone application.
當(dāng)我們談到客戶(hù)端(Client)時(shí)圣拄,我們指的時(shí)運(yùn)行在用戶(hù)網(wǎng)頁(yè)瀏覽器(典型的如:FireFox或Safari,或一些和原生iPhone應(yīng)用中的UIWebView一樣復(fù)雜的程序)中的代碼毁欣。
服務(wù)器端(Server)
The Meteor server is a HTTP and DDP server run via node.js. It consists of the all the Meteor libraries as well your server- side JavaScript code. When you start your Meteor server, it connects to a Mongo database (which it starts itself in development).
Meteor服務(wù)器是一個(gè)通過(guò)node.js來(lái)運(yùn)行的HTTP和DDP服務(wù)器庇谆。它除了由你的服務(wù)器端Javascript代碼,還有所有的Meteor庫(kù)組成署辉。當(dāng)你啟動(dòng)你的Meteor服務(wù)器族铆,它會(huì)連接到一個(gè)Mongo數(shù)據(jù)庫(kù)(在開(kāi)發(fā)時(shí)它會(huì)自啟動(dòng))。
方法(Method)
A Meteor Method is a remote procedure call from the client to the server, with some special logic to keep track of collection changes and allow Latency Compensation.
Meteor方法(Method)是指一個(gè)從客戶(hù)端到服務(wù)器端的遠(yuǎn)程過(guò)程調(diào)用哭尝,該調(diào)用帶有一些特別的業(yè)務(wù)邏輯來(lái)保持?jǐn)?shù)據(jù)集變更的跟蹤并允許延遲補(bǔ)償(Latency Compansation)哥攘。
延遲補(bǔ)償(Latency Compensation)
Is a technique to allow simulation of Method calls on the client, to avoid lagginess while waiting for the server to respond.
是一種允許在客戶(hù)端方法(Method)調(diào)用的模擬技術(shù),當(dāng)?shù)却?wù)器端響應(yīng)時(shí)材鹦,它用來(lái)避免延遲卡頓逝淹。
模板(Template)
A template is a method of generating HTML in JavaScript. By default, Meteor supports Handlebars, a logic-less templating system, although there are plans to support more in the future.
模板是Javascript中用于生成HTML的方法。盡管Meteor計(jì)劃以后會(huì)支持更多的模板桶唐,但當(dāng)前它只默認(rèn)支持Handlebar栅葡,一種無(wú)邏輯模板系統(tǒng)。
模板數(shù)據(jù)上下文(Template Data Context)
When a template renders, it refers to a JavaScript object that provides specific data for this particular rendering. Usually such objects are plain-old-JavaScript-objects (POJOs), often documents from a collection, although they can be more complicated and have functions available on them.
當(dāng)一個(gè)模板渲染時(shí)尤泽,它指向一個(gè)為此次渲染提供特定數(shù)據(jù)的Javascript對(duì)象欣簇。盡管這樣的對(duì)象可以變得更復(fù)雜并且可在其上面附帶可用的函數(shù),但通常文檔來(lái)自一個(gè)集合坯约,它們是不含業(yè)務(wù)邏輯的Javascript簡(jiǎn)單對(duì)象(POJO)熊咽。
輔助程序(Helpers)
When a template needs to render something more complex than a document property it can call a helper, a function that is used to aid rendering.
當(dāng)一個(gè)模板需要渲染比一個(gè)文檔屬性更復(fù)雜的東西時(shí),它可以調(diào)用輔助程序闹丐,一個(gè)常用來(lái)幫助渲染的函數(shù)横殴。
會(huì)話(huà)(Session)
The Session in Meteor refers to a client-side reactive data source that's used by your application to track the state that the user's in.
在Meteor中,會(huì)話(huà)是指一種客戶(hù)端的響應(yīng)性數(shù)據(jù)資源卿拴,被你的應(yīng)用程序用來(lái)跟蹤用戶(hù)里的狀態(tài)衫仑。
發(fā)布(Publication)
A publication is a named set of data that is customized for each user that subscribes to it. You set up a publication on the server.
發(fā)布是一套為每個(gè)訂閱它的用戶(hù)定制的數(shù)據(jù)。你要在服務(wù)器上設(shè)置一個(gè)發(fā)布堕花。
訂閱(Subscription)
A subscription is a connection to a publication for a specific client. The subscription is code that runs in the browser that talks to a publication on the server and keeps the data in sync.
訂閱是一個(gè)到相應(yīng)指定客戶(hù)端的發(fā)布的連接文狱。該訂閱是指運(yùn)行在瀏覽器中的代碼,它與服務(wù)器上一個(gè)發(fā)布進(jìn)行對(duì)話(huà)并保持?jǐn)?shù)據(jù)同步缘挽。
游標(biāo)(Cursor)
A cursor is the result of running a query on a Mongo collection. On the client side, a cursor isn't just an array of results, but a reactive object that can be observed as objects in the relevant collection are added, removed and updated.
游標(biāo)是在一個(gè)Mongo集合上運(yùn)行查詢(xún)后的結(jié)果集如贷。在客戶(hù)端上陷虎,游標(biāo)不僅僅是一個(gè)結(jié)果集的數(shù)組到踏,也是一個(gè)能在相關(guān)集合做增刪改時(shí)可被觀測(cè)的響應(yīng)對(duì)象杠袱。
包(Package)
A Meteor package can consist of 1. JavaScript code to run on the server. 2. JavaScript code to run on the client. 3. Instructions on how to process resources (such as SASS to CSS). 4. Resources to be processed.
A package is like a super-powered library. Meteor comes with an extensive set of core packages. There's also Atmosphere, which is a collection of community supplied third party packages.
一個(gè)Meteor程序包由以下幾方面組成:1. 在服務(wù)器端運(yùn)行的Javascript代碼;2. 在客戶(hù)端運(yùn)行的Javascript代碼窝稿;3. 如何處理各類(lèi)資源的指令(例如:用于CSS的SASS)楣富;4. 被處理的各類(lèi)資源。
一個(gè)包類(lèi)似于一個(gè)超強(qiáng)的庫(kù)伴榔。Meteor帶來(lái)了很多套核心包纹蝴。還有Atmosphere上一大批社區(qū)提供的第三方包
依賴(lài)(Deps)
Deps is Meteor's reactivity system. Deps is used behind the scenes to keep HTML automatically sync with the underlying data model.
Deps是Meteor的響應(yīng)系統(tǒng)。Deps常被用于業(yè)務(wù)場(chǎng)景后使HTML與底層數(shù)據(jù)模型自動(dòng)保持同步踪少。