What is declarative programing? It's when you define the behavior of the class using declarations instead of writing code.
Example:
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod] <<< declarative programming
Another example is lambdas. In the following example, retrieve all records that begin with "test":
List
List
Imperative example would be:
List filteredList2 = new List();
foreach (string list in lis)
if (list.StartsWith("test"))
filteredList2.Add(list);
No comments:
Post a Comment