diff Lib/IMPL/Web/View/TTView.pm @ 371:d5c8b955bf8d

refactoring
author cin
date Fri, 13 Dec 2013 16:49:47 +0400
parents 833e663796c4
children 6f2a494579cb
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTView.pm	Tue Dec 10 03:02:01 2013 +0400
+++ b/Lib/IMPL/Web/View/TTView.pm	Fri Dec 13 16:49:47 2013 +0400
@@ -7,7 +7,8 @@
 use IMPL::declare {
 	require => {
 		Context => 'IMPL::Web::View::TTContext',
-		Loader  => 'IMPL::Code::Loader'
+		Loader  => 'IMPL::Code::Loader',
+		Factory => 'IMPL::Web::View::ObjectFactory'
 	},
 	base => [
 		'IMPL::Object' => undef,
@@ -86,10 +87,15 @@
 						warn @_;
 					},
 					is => sub {
-						return is(shift,shift);
+						my ($obj,$class) = @_;
+						if (is($class,Factory)) {
+							return is($obj,$class->factory);
+						} else {
+							return is($obj,$class);
+						}
 					},
 					import => sub {
-						return Loader->safe->Require(shift);
+						return Factory->new(Loader->safe->Require(shift));
 					},
 					toJSON => sub {
 						return JSON->new()->utf8->pretty->encode(shift);