Headline

Internal DSL technique using a series of unrelated calls.

Characteristics

This implementation demonstrates the Internal DSL pattern called Function Sequence. Function Sequence consists of a series of unrelated calls, which are ordered in a sequence but only by time of execution. There is no data relationship between the calls, thus context variables are needed. Another possibility is to use Object Scoping. Another thing thats needed are global functions or some kind of namespace control in your used language. This implementation uses Java and benefits of the static imports.

Function Sequence is ideal for DSLs high level statements and should normally be combined with the other Internal DSL techniques like Method Chaining and Nested Function

Illustration

Similar to feature:Parsing ...

public class CBBigExample extends CompanyBuilder{

	@Override
	protected void build() {
	company("ACME Corporation");
		department("Research");
			manager("Craig");
				address("Redmond");
				salary(123456);
			employee("Erik");
				address("Utrecht");
				salary(12345);
			employee("Ralf");
				address("Koblenz");
				salary(1234);
		endDepartment();
		department("Development");
			manager("Ray");
				address("Redmond");
				salary(234567);
				
			department("Dev1");
				manager("Klaus");
					address("Boston");
					salary(23456);
					
				department("Dev1.1");
					manager("Karl");
						address("Riga");
						salary(2345);
					employee("Joe");
						address("Wifi City");
						salary(2344);
				endDepartment();
			endDepartment();
		endDepartment();
	}

}

here.


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.