???????????? ?????????? ??????? ? ?????????????? ???????????? ?????? ???????????????? ?? ??????? Ruby - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

???????????? ?????????? ??????? ? ?????????????? ???????????? ?????? ???????????????? ?? ??????? Ruby

Description:

... – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 25
Provided by: ade126
Category:
Tags: rails | ruby

less

Transcript and Presenter's Notes

Title: ???????????? ?????????? ??????? ? ?????????????? ???????????? ?????? ???????????????? ?? ??????? Ruby


1
???????????? ?????????? ??????? ? ??????????????
???????????? ?????? ???????????????? ?? ???????
Ruby
?????? ????????
Kirill.Timofeev_at_dataart.com
23.10.2008
2
????????? ???????
  • ?????????? ????????????????
  • ????? ???????? ? ?????????? ?????????
  • ??????????? ????????????? ????? Ruby
  • ?????????? ??????????? ???????
  • ????????-??????????????? ??????
  • ???????????? ??????
  • ??????????

3
???????????? ??????????? ????????????????
  • ???????????????? ? ?????????? ????????????
    ??????????? ?????????? ????????????
  • ??????????? ??????????? ???????????? ????????
  • ??????????? ????????????

4
?????????? ??????????? ????????????????
  • ??????????? ??????????? ????
  • ???????? ????????? ? ???????
  • ???????????? ? ??????????? ??????????? ????

5
????? ???????? ? ??????? ?????????? ?????????
  • ????????? ?????? ????????????????
  • ?????????????? ????????? ???? ?? ?????????
    ?????????
  • ?????? ????????? ???? ? ??????????? ???????????
    ??????????

6
???????????? ?????????? ??? ??????? ????????? ????
  • ????????????? ?????? ? ???????? ? ????????????
    ?????????? ??????? ??? ????????????? ????????????
    ?????? ????????????????
  • ?????????? STROBE
  • ?????? Acts as State Machine ??? Ruby on Rails

7
?????????? ???????????? ???????
  • ?????????????? ???????????? ?? ?????? ???????
    ?????? ???????? ??????? ?????????
  • ????????????? ???????????? ??? ???????? ?????????

8
???????????? ????? ????????????????
  • ????????? ????????? ?????????, ?????? ??? ???????
    ? ??????? ?????????? ?????? ???? ?? ?????
    ?????????? ?????????
  • ????????? ????? ?????????? ? ???? ?????? (?????
    eval)?
  • ???????????? ???????
  • ????????? ????????? ??????????????? ?????

9
?????????????? ????? ????????????????
  • ??????? ????????? ???????? ?? ??????
    ????????????? ???????
  • ???????????
  • ???????? ???????????? ? ??????????? ?? ??????
    ???????? ??????????????? ??????????????
    ???????????? ????????
  • ?????????? ????????????? ????????? ? ??????

10
??????????? ????? Ruby
  • ?????-?????????????
  • ????????-???????????????
  • ????????????
  • ???????? ???????? ??????????????? ?????

11
??????????? Ruby
  • ?????????? ?????????-???????????????? ?????
    ????????? ???????
  • ???????? ??????????? ????????
  • ??????????? ??????? ??????? ??????????? ????????
    ??????????? ??????? ? ??????????? ???

12
????????????? ??????????? ??????? ??? ??????????
???????
13
???????????? ? ???????? ?????????
14
??????? ????? ?????? ? ??????
15
????????????? ?????? ?????? ? ???????
16
?????????
class Main lt State def initialize container
super Main, container end end
17
??????
class Opened lt Automaton def initialize name,
containernil super name, container end  
def C _at_container.state Closed RT()?
end   private def RT true end end
18
???????
class FileAbstract lt Automaton def initialize
name, containernil super name, container
automaton Closed.new(Closed, self),
Opened.new(Opened, self)? initial Closed
end end
19
???????????? ? ???????? ?????????
??????????? ?????? ????????? ? ??????? ????????
????????? ???????, ??? ????????? ?????????
???????? ???????? ??? ???????? ??? ?
????????-??????????????? ???. ?????????? ????????
?????? ????????????, ????????? ? ??????????????
????????????? ?????????????? ??????????? ?????,
??? ?? ????????? ????? ?????????????? ??????
????????? ? ????????? ???
20
???????????? ? ???????? ????????? ? ???????
???????????? ??????? Ruby
class AbstractFile lt AutomatonClass automaton
do initial closed group closed do
initial main state main end
group opened do end transition c,
from gt opened, to gt closed
transition iso, from gt closed,
to gt closed, proc gt lambda
transition iso, from gt
opened, to gt opened, proc gt
lambda end end
21
???????????? ? ???????? ?????????
  • ???????????
  • ?????????? ?????????????? ????????????
  • ????????????? ?????????-???????????????? ?????
    (DSL)
  • ??????????
  • ?????? ???????? ????????????? ????????

22
????????????????
class ReadFile lt AbstractFile def initialize
name, containernil super name, container
automaton ReadOpened.new(Opened, self),
ReadClosed.new(Closed, self)? end  
tracer end
23
??????????
  • ??????????? ???????? ????? ???????? ???????????
    ????????-???????????????? ? ?????????????
    ????????
  • ?????????-??????????????? ???? ????? ???????????
    ??? ???????? ??????? ????????-????????????????
    ???????.

24
??????? ?? ????????! ????????
Write a Comment
User Comments (0)
About PowerShow.com