Business Natural Languages Development in Ruby
Jay Fields presents his concept of Business Natural Languages - a type of Domain Specific Languages geared towards being readable by domain experts.
Tracking change and innovation in the enterprise software development community
Posted by Werner Schuster on Sep 19, 2007 12:05 AM
The experimentation in the Ruby GUI space continues. There are many old style bindings to GUI toolkits such as Qt or GTK, or embedded DSLs or APIs based on JRuby such as these three new ways of building GUIs with Swing. These libraries use different approaches for building and arranging GUI components.l = text "0"The
animate(24) do |i|
l.replace "#{i}"
end
animate call handles animation in a very succinct way. The numeric parameter is the frame rate for the animation, and the given block is executed update the animation at the given rate. Shoes.app doThe animation and graphics capabilities lower the barrier for graphical applications such as visualization or creation of teaching materials. This shouldn't be surprising, as Ruby Shoes originated with the Hackety project, aimed at making programming easy for programming beginners.
radius = 20.0
vert = width - 30.0
hor = width - 30.0
o = oval(hor, vert, 10.0)
animate(10) do |anim|
nofill
clear do
oval(hor - radius, vert-radius, radius*2.0)
satellites = vert /10
satellites.to_i.times {|x|
h = hor + Math::sin(((6.28/satellites) * x )) * 40.0
v = vert - Math::cos(((6.28/satellites) * x ))* 40.0
fill rgb(1.0/satellites, 1.0/satellites, 0.8)
oval(h, v, 5.0)
}
skew vert/10*Math::cos(anim)
end
end
motion do |x,y|
hor, vert = x, y
end
end
1 module UtilThis code shows some concepts that Ruby Shoes uses.
2 def self.find_objects(name, from=0, to=10)
3 objects = []
4 c = 0
5 # get the class object from its name string
6 name_const = eval(name)
7 ObjectSpace::each_object( name_const ){|x |
8 if c >= from
9 objects << x
10 end
11 break if c >= to
12 c += 1
13 }
14 objects.sort{|first, second| first.to_s <=> second.to_s }
15 end
16 end
17 class ClassList < Shoes
18 url '/', :index
19 url '/objects/(\d+)', :object
20 url '/next', :next_page
21 url '/prev', :prev_page
22 def index
23 @@from = 0
24 object(0)
25 end
26 def next_page
27 @@from += 10
28 object(@@from)
29 end
30 def prev_page
31 @@from -= 10
32 object(@@from)
33 end
34 def object(num)
35 @@from ||= 0
36 num = num.to_i
37 stack :width => 500 do
38 flow :width => 200, :margin => 10, :margin_left => 200, :margin_top => 20 do
39 obj = Util::find_objects(@@objects[num].to_s)
40 text "#{obj.size}:" + obj.join(',')
41 end
42 flow :width => 380, :margin_left => 10 do
43 @@links = text ""
44 links = ""
45 if @@from >= 10
46 links += "<a href='/prev'>prev</a>\n"
47 end
48 @@objects[@@from, @@from+10].each_with_index{|el, idx|
49 links += "<span> <a href='/objects/#{@@from + idx}'>#{el}</a></span>"
50 }
51 links += "<a href='/next'> next</a>"
52 @@links.replace links
53 end
54 end
55 end
56 end
57 @@objects = Util::find_objects("Class", 0, 200)
58 Shoes.app :width => 640, :height => 700, :title => "Classes"
index method. In the same way, everything under the objects/ directory is routed to the object method, with everything after the slash passed to the handler method as argument. This is an easy way of associating events with handler functions, unlike the Publish/Subscribe model that is otherwise used for GUI interaction IBM Web 2.0 Developer eKit: Free Tutorials, Webcasts, Whitepapers
IBM software architect eKit: Grady Booch podcast, whitepapers, articles
Introducing Project Zero: Building RESTful services for your Web application
Info 2.0: IBM's vision for the world of Web 2.0 and enterprise mashups (Webcast)
Jay Fields presents his concept of Business Natural Languages - a type of Domain Specific Languages geared towards being readable by domain experts.
Adoption and interest for Distributed Version Control Systems is constantly rising. We will introduce the concept of DVCS and have a look at 3 actors in the area: git, Mercurial and Bazaar.
Deborah Hartmann interviewed Segundo Velasquez about his experience as customer with an Agile team during the initial phase of software design of a product.
David Cooksey shows how to fine grained versioning to a ClickOnce deployment using an HttpHandler written with ASP.NET, making partial rollouts to a test audience much easier.
Windows workflow (WF) is an excellent framework for implementing business processes, but lacks support for human activities. This article describes a completely generic approach for changing this.
In this interview taken during OOPSLA 2007, Markus Voelter talks about the importance of documenting the software architecture, and gives some good and also bad examples on how it could be done.
William Soo and Meeraj Kunnumpurath discuss the Voca transaction processing system, architectural challenges and requirements, Voca's Spring/J2EE architecture, and the future SEPA architecture.
Security is about trade-offs. Only a few have the expertise to design good security. This talk focuses on Security Patterns, such as Role-based Access Control, Single Access Point, and Front Door.
No comments
Reply