annotate Lib/IMPL/Config.pm @ 100:df6b4f054957

Schema in progress Added simple mailer
author wizard
date Thu, 06 May 2010 00:54:17 +0400
parents 2f31ecabe9ea
children 76515373dac0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
1 package IMPL::Config;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
3 use warnings;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
4
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
5 use base qw(IMPL::Object::Accessor IMPL::Object::Serializable IMPL::Object::Autofill);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
6
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
7 __PACKAGE__->PassThroughArgs;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
8
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
9 use IMPL::Class::Member;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
10 use IMPL::Class::PropertyInfo;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
11 use IMPL::Exception;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
12
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
13 use IMPL::Serialization;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
14 use IMPL::Serialization::XmlFormatter;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
15
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
16
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
17
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
18 sub LoadXMLFile {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
19 my ($self,$file) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
20
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
21 my $class = ref $self || $self;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
22
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
23 my $serializer = new IMPL::Serializer(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
24 Formatter => new IMPL::Serialization::XmlFormatter(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
25 IdentOutput => 1,
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
26 SkipWhitespace => 1
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
27 )
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
28 );
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
29
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
30 open my $hFile,'<',$file or die new IMPL::Exception("Failed to open file",$file,$!);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
31
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
32 my $obj;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
33 eval {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
34 $obj = $serializer->Deserialize($hFile);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
35 };
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
36
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
37 if ($@) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
38 my $e=$@;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
39 die new IMPL::Exception("Can't load the configuration file",$file,$e);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
40 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
41 return $obj;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
42 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
43
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
44 sub SaveXMLFile {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
45 my ($this,$file) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
46
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
47 my $serializer = new IMPL::Serializer(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
48 Formatter => new IMPL::Serialization::XmlFormatter(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
49 IdentOutput => 1,
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
50 SkipWhitespace => 1
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
51 )
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
52 );
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
53
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
54 open my $hFile,'>',$file or die new IMPL::Exception("Failed to open file",$file,$!);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
55
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
56 $serializer->Serialize($hFile, $this);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
57 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
58
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
59 sub xml {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
60 my $this = shift;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
61 my $serializer = new IMPL::Serializer(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
62 Formatter => new IMPL::Serialization::XmlFormatter(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
63 IdentOutput => 1,
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
64 SkipWhitespace => 1
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
65 )
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
66 );
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
67 my $str = '';
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
68 open my $hFile,'>',\$str or die new IMPL::Exception("Failed to open stream",$!);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
69
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
70 $serializer->Serialize($hFile, $this);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
71
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
72 undef $hFile;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
73
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
74 return $str;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
75 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
76
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
77 sub save {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
78 my ($this,$ctx) = @_;
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
79
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
80 my $val;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
81
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
82 $val = $this->rawGet($_) and $ctx->AddVar($_ => $val) foreach map $_->Name, $this->get_meta(
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
83 'IMPL::Class::PropertyInfo',
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
84 sub {
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
85 $_->Access == IMPL::Class::Member::MOD_PUBLIC and
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
86 $_->canGet;
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
87 },
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 60
diff changeset
88 1);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
89 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
90
58
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
91 sub spawn {
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
92 goto &LoadXMLFile;
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
93 }
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
94
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
95 sub get {
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
96 my $this = shift;
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
97
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
98 if (@_ == 1) {
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
99 my $obj = $this->SUPER::get(@_);
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
100 return UNIVERSAL::isa($obj,'IMPL::Config::Activator') ? $obj->activate : $obj;
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
101 } else {
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
102 my @objs = $this->SUPER::get(@_);
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
103 return map UNIVERSAL::isa($_,'IMPL::Config::Activator') ? $_->activate : $_, @objs ;
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
104 }
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
105 }
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
106
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
107 sub rawGet {
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
108 my $this = shift;
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
109 return $this->SUPER::get(@_);
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
110 }
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
111
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
112 sub Exists {
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
113 $_[0]->SUPER::get($_[1]) ? 1 : 0;
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
114 }
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
115
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
116 1;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
117 __END__
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
118
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
119 =pod
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
120
73
wizard
parents: 63
diff changeset
121 =head1 NAME
wizard
parents: 63
diff changeset
122
wizard
parents: 63
diff changeset
123 C<IMPL::Config> - базовый класс для настраиваемого приложения.
wizard
parents: 63
diff changeset
124
wizard
parents: 63
diff changeset
125 =head1 SYNOPSIS
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
126
73
wizard
parents: 63
diff changeset
127 =begin code
wizard
parents: 63
diff changeset
128
wizard
parents: 63
diff changeset
129 # define application
wizard
parents: 63
diff changeset
130
wizard
parents: 63
diff changeset
131 package MyApp;
wizard
parents: 63
diff changeset
132 use base qw(IMPL::Config);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
133
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
134 use IMPL::Class::Property;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
135 use IMPL::Config::Class;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
136
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
137 BEGIN {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
138 public property SimpleString => prop_all;
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
139 public property DataSource => prop_all;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
140 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
141
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
142 sub CTOR {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
143 my $this = shift;
73
wizard
parents: 63
diff changeset
144
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
145 $this->DataSource(
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
146 new IMPL::Config::Activator(
73
wizard
parents: 63
diff changeset
147 factory => 'MyDataSource',
wizard
parents: 63
diff changeset
148 parameters=>{
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
149 host => 'localhost',
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
150 user => 'dbuser'
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
151 }
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
152 )
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
153 ) unless $this->Exists('DataSource');
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
154 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
155
73
wizard
parents: 63
diff changeset
156 # using application object
58
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
157
73
wizard
parents: 63
diff changeset
158 my $app = spawn MyApp('default.xml');
58
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
159
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
160 $app->Run();
a35b60b16a99 Configuration, late activation
wizard
parents: 49
diff changeset
161
73
wizard
parents: 63
diff changeset
162 =end code
wizard
parents: 63
diff changeset
163
wizard
parents: 63
diff changeset
164 Ниже приведен пример файла C<default.xml> содержащего настройки приложения
wizard
parents: 63
diff changeset
165
wizard
parents: 63
diff changeset
166 =begin code xml
wizard
parents: 63
diff changeset
167
wizard
parents: 63
diff changeset
168 <app type='MyApp'>
wizard
parents: 63
diff changeset
169 <SimpleString>The application</SimpleString>
wizard
parents: 63
diff changeset
170 <DataSource type='IMPL::Config::Activator'>
wizard
parents: 63
diff changeset
171 <factory>MyDataSourceClass</factory>
wizard
parents: 63
diff changeset
172 <parameters type='HASH'>
wizard
parents: 63
diff changeset
173 <host>localhost</host>
wizard
parents: 63
diff changeset
174 <user>dbuser</user>
wizard
parents: 63
diff changeset
175 </parameters>
wizard
parents: 63
diff changeset
176 </DataSource>
wizard
parents: 63
diff changeset
177 </app>
wizard
parents: 63
diff changeset
178
wizard
parents: 63
diff changeset
179 =end code xml
wizard
parents: 63
diff changeset
180
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
181 =head1 DESCRIPTION
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
182
73
wizard
parents: 63
diff changeset
183 C<[Serializable]>
wizard
parents: 63
diff changeset
184
wizard
parents: 63
diff changeset
185 C<[Autofill]>
wizard
parents: 63
diff changeset
186
wizard
parents: 63
diff changeset
187 C<use base IMPL::Object::Accessor>
wizard
parents: 63
diff changeset
188
wizard
parents: 63
diff changeset
189 Базовый класс для приложений. Использует подход, что приложение
wizard
parents: 63
diff changeset
190 является объектом, состояние которого предтавляет собой конфигурацию,
wizard
parents: 63
diff changeset
191 а методы - логику.
wizard
parents: 63
diff changeset
192
wizard
parents: 63
diff changeset
193 Данный класс реализует функционал десериализации (и сериализации) экземпляра
wizard
parents: 63
diff changeset
194 приложения из XML документа. Для этого используется механизм C<IMPL::Serialization>.
wizard
parents: 63
diff changeset
195 При этом используются опции C<IMPL::Serialization::XmlFormatter> C<IdentOutput> и
wizard
parents: 63
diff changeset
196 C<SkipWhitespace> для записи документа в легко читаемом виде.
wizard
parents: 63
diff changeset
197
wizard
parents: 63
diff changeset
198 Поскольку в результате восстановления приложения восстанавливаются все элементы
wizard
parents: 63
diff changeset
199 из файла конфигурации, то это может потребовать значительных ресурсов для
wizard
parents: 63
diff changeset
200 создания частей, которые могут никогда не понадобиться. Например, не требуется инициализация
wizard
parents: 63
diff changeset
201 источника данных для передачи пользователю статических данных, сохраненных на диске.
wizard
parents: 63
diff changeset
202
wizard
parents: 63
diff changeset
203 Для решения этой проблемы используются специальные объекты C<IMPL::Config::Activator>.
wizard
parents: 63
diff changeset
204
wizard
parents: 63
diff changeset
205 Если у приложения описано свойство, в котором хранится C<IMPL::Config::Activator>, то
wizard
parents: 63
diff changeset
206 при первом обращении к такому свойству, будет создан объект вызовом метода
wizard
parents: 63
diff changeset
207 C<< IMPL::Config::Activator->activate() >> и возвращен как значение этого свойства.
wizard
parents: 63
diff changeset
208 Таким образом реализуется прозрачная отложенная активация объектов, что позволяет
wizard
parents: 63
diff changeset
209 экономить ресурсы.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
210
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
211 =head1 MEMBERS
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
212
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
213 =over
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
214
73
wizard
parents: 63
diff changeset
215 =item C<[static] LoadXMLFile($fileName) >
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
216
73
wizard
parents: 63
diff changeset
217 Создает из XML файла C<$fileName> экземпляр приложения
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
218
73
wizard
parents: 63
diff changeset
219 =item C<SaveXMLFile($fileName)>
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
220
73
wizard
parents: 63
diff changeset
221 Сохраняет приложение в файл C<$fileName>
wizard
parents: 63
diff changeset
222
wizard
parents: 63
diff changeset
223 =item C<[get] xml >
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
224
73
wizard
parents: 63
diff changeset
225 Сохраняет конфигурацию приложения в XML строку.
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
226
73
wizard
parents: 63
diff changeset
227 =item C<[static,operator] spawn($file)>
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
228
73
wizard
parents: 63
diff changeset
229 Синоним для C<LoadXMLFile>, предполагается использование как оператора.
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
230
73
wizard
parents: 63
diff changeset
231 =item C<rawGet($propname,...)>
wizard
parents: 63
diff changeset
232
wizard
parents: 63
diff changeset
233 Метод для получения значений свойств приложения. Данный метод позволяет избежать
wizard
parents: 63
diff changeset
234 использование активации объектов через C<IMPL::Config::Activator>.
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 58
diff changeset
235
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
236 =back
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
237
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
238 =cut