Boo Example 7

Source: Internet
Author: User
Several DSL examples implemented based on the boo language can be used as a reference for our learning.

Brail

Castle Project

Http://www.castleproject.org/monorail/documentation/trunk/viewengines/brail/index.html.

It's a text templating language, built by me, in which in you can mix code and text freely. Here's a sample:

<H1> my name is $ {name}

<Ul>

<% For element in list: %>

<Li >$ {element} </LI>

<% End %>

</Ul>

Rhino ETL

Rhino ETL employs the concept of steps, with data flowing from one step to the next.

Usually the first step will extract the data from some source, and the last will load it

The final destination.

Here's an example of a full ETL process:

Operationsplit_name:

For row in rows:

Continue if row. Name is null

Row. firstname, row. lastname = row. Name. Split ()

Yield row

Processuserstopeople:

Input "source_db", command = "select ID, name, email from users"

Split_names ()

Output "destination_db", command = """

Insert into people (userid, firstname, lastname, email)

Values (@ userid, @ firstname, @ lastname, @ email)

""":

Row. userid = row. ID

This code gets the users list from the source database, splits the names, and then saves

Them to the destination database. This is a good example of a DSL that requires some

Knowledge of the domain before you can utilize it.

Http://www.ayende.com/Blog/category/545.aspx

Bake (BOO build system)

Task "init build dir ":

If not directory. exists ("build "):

Mkdir "build"

Cpfileset ("lib/*. dll"). Files, "Build", true

Http://code.google.com/p/boo-build-system/

Specter

Specter is a behavior-driven development (BDD) Testing Framework

Context "Empty stack ":

Stack as stack

Setup:

Stack = stack ()

Specifystack. Count. Must = 0

Specify "stack must accept an item and count is then one ":

Stack. Push (42)

Stack. Count. Must = 1

Http://behaviour-driven.org/

Http://specter.sourceforge.net/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.