From ak at navel.gr Fri Apr 1 08:29:54 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Fri, 01 Apr 2005 16:29:54 +0300 Subject: [Nitro] MS Sql Server adapter Message-ID: <424D4CD2.6080406@navel.gr> Hello all, I started creating the SQL Server adapter for OG. Apparently it's almost done - at least it passes successfuly all the test cases. I have sent it to George who will (hopefully ;-) include it in the next version of og. Let me note some issues I run into while making the adapter: - I had to name it SqlserverAdapter, not SqlServerAdapter, due to og\adapter.rb:43: eval %{ return #{name.capitalize}Adapter.instance } - It was hard to track down some error messages from the ms sql driver. It would be much better if we use eval <<-EOE, __FILE__, __LINE__ ... instead of eval %{ } - Another issue that made debugging difficult is the use of *ensure* at the end of some functions, without a previous *rescue*. Apparently, should an exception was risen in the function body, no error message was reported! - @typecast is probably not needed in the adapter class - It would be nice if we used a globally unique identifier for all objects in the database, so that we could do an og.get(123). Then again this could be difficult to implement... - we should re-write the adapters, combining multiple sql statements in one using the *;* separator when this is possible. - we should definately use transactions in more places - the *store* attribute could be renamed to db_handle BTW, it was really nice having the chance to work again on the og/nitro code and check out how much it has improved since the last time (almost 6 months ago). I'm pretty sure that this is due to the ruby community and that this is just the beginning! Regards, Tasos -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From james_b at neurogami.com Sat Apr 2 23:54:37 2005 From: james_b at neurogami.com (James Britt) Date: Sat, 02 Apr 2005 21:54:37 -0700 Subject: [Nitro] Placing tempaltes and includes outside of 'public' directory Message-ID: <424F770D.4030107@neurogami.com> Is there some what to have a template file under /public, and have it include another file in a sibling directory? I have this directory tree /conf /public /log /templates my index.xhtml file has so it can slurp in header.xhtml but it fails. I've also tried My run.rb (this is running under WEBrick) has N::Runner.run( :host => '127.0.0.1', :port => 9999 , :template_root => 'templates', :name => "Tagegory" ) which I though would tell Nitro to look in templates/ for files. On a related issue, if I simply put the header file in the same dir as index.xhtml, and use then it works. If I try to put the header file is a subdirectory of public, and use this I get errors about no such action. Thanks, James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From george.moschovitis at gmail.com Sun Apr 3 04:29:38 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 3 Apr 2005 11:29:38 +0300 Subject: [Nitro] Placing tempaltes and includes outside of 'public' directory In-Reply-To: <424F770D.4030107@neurogami.com> References: <424F770D.4030107@neurogami.com> Message-ID: Hello > Is there some what to have a template file under /public, and have it > include another file in a sibling directory? > > I have this directory tree > ... > in 0.14.0 you can do: class MyController < Controller @template_root = 'templates' ... end then in your html: But I 'll change this so that your version works too. Please be patient. > N::Runner.run( :host => '127.0.0.1', > :port => 9999 , > :template_root => 'templates', > :name => "Tagegory" > ) If you set the templates root then you should just: > On a related issue, if I simply put the header file in the same dir as > index.xhtml, and use > ... > As I said, will fix ASAP. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Sun Apr 3 17:05:36 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 4 Apr 2005 00:05:36 +0300 Subject: [Nitro] Placing tempaltes and includes outside of 'public' directory In-Reply-To: References: <424F770D.4030107@neurogami.com> Message-ID: Fixed it, now you can render from subdirs. Will be available in the next version. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From epiperak at softlab.ece.ntua.gr Sat Apr 2 05:52:24 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Sat, 2 Apr 2005 13:52:24 +0300 (EEST) Subject: [Nitro] Hello Everyone... In-Reply-To: Message-ID: After a lot of thought, deep consideration, and a lot of research on the topic, I decided to stop the developing of my web app on *r*l* (I promised a friend I will never use the "r" word again, ..., anyway... , and join the world of Nitro. Anyway, ... I would like to say hello to everyone... :-) Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Mon Apr 4 05:21:04 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 4 Apr 2005 12:21:04 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.15.0 Message-ID: Hello everyone, new versions of Nitro and Og were just released. Homepage + Downloads: http://nitro.rubyforge.org A great release. Many cool new features and tons of subtle improvements. We also welcome a new core developer, Anastastios Koutoumanos, who's first contribution is the new SqlServer adapter. Most notable additions: * Advanced localization support: locale_en = { 'See you' => 'See you', :long_paragraph => 'The best new books, up to 30% reduced price', :price => 'Price: %d %s', :proc_price => proc { |value, cur| "Price: #{value} #{cur}" } } locale_de = { 'See you' => 'Auf wieder sehen', ... } lc = Localization.get lc['See you'] -> See you lc[:price, 100, 'euro'] -> Price: 100 euro lc = Localization.get[:de] lc['See you'] -> Auf wiedersehen Using the LocalizationShader you can have templates like this:

[[This is a localized]] String

do you [[:like]] this?

All strings enclosed in [[ ]] are replaced with localized versions (honouring the session locale). Localization rules can also be provided with a .yml file. Check out the updated blog example. * Dynamic/Parametrised mixins. A great extension to Ruby's mixin feature. The Og::list implementation is replaced with the new Orderable dynamic mixin, here is an example: class Comment property :body, String belongs_to :article, Article include Orderable, :scope => article end c.move_higher The Orderable mixin uses the :scope parameter to dynamically alter the methods appended to the Comment class. This new feature will be used throughout the platform. * NestedSets mixin: class Comment include NestedSets end or class Comment include Hierarchical, :method => :nested_sets end c.add_comment(child_comment) c.full_children c.direct_children c.children this is a reimplementation of the SqlTraversable mixin available in older versions. * Improved templating system. Now allows <% %> intrerpolators and provides a number of html morphing effects:
admin interface
  • #{u.first_name} #{u.last_name}
and more... * Og provides an SqlServer adapter out of the box. * Improved scaffolding code (still a lot more to come). * Build default environment, introduced nitro and nitrogen commands to help new users. * Many, many small improvements and fixes. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Mon Apr 4 23:32:00 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 04 Apr 2005 20:32:00 -0700 Subject: [Nitro] Tempalte hack and feature requet Message-ID: <425206B0.6000009@neurogami.com> I was wondering about doing a conditional header include, so that each page in a Web site can have a common set of links , but not link back to itself. Here's a simple example, where the index page doesn't need a link to itself. # file header.xhtml ----- My Blog" links = "My Blog" if caller[6] =~ /index/ ?> # end file ----- This gets included into index.xhtml, and other pages, and manages to detect the calling xhtml page. But it feels hackish, and wonder if there was, or could be, a cleaner way for one file to know what parent page was including it. Thanks, James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From ak at navel.gr Tue Apr 5 03:22:07 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Tue, 05 Apr 2005 10:22:07 +0300 Subject: [Nitro] Hello Everyone... In-Reply-To: References: Message-ID: <42523C9F.4060308@navel.gr> Emmanuel Piperakis wrote: > After a lot of thought, deep consideration, and a lot of research on the > topic, I decided to stop the developing of my web app on *r*l* (I promised > a friend I will never use the "r" word again, ..., anyway... , and join > the world of Nitro. > > Anyway, ... I would like to say hello to everyone... :-) > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general Hello Emmanouil! Nice to have you on board ;-) Now, could you explain this? Your name and email address seem Greek (to me...) but a little trace (sorry, couldn't resist!) leads to Tokyo, Japan! So where are you located, what are you working on? Are you in any way related to Matz!??!! enJOY! Tasos Koutoumanos -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From george.moschovitis at gmail.com Tue Apr 5 04:29:17 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 5 Apr 2005 11:29:17 +0300 Subject: [Nitro] Tempalte hack and feature requet In-Reply-To: <425206B0.6000009@neurogami.com> References: <425206B0.6000009@neurogami.com> Message-ID: > I was wondering about doing a conditional header include, so that each > ... > there was, or could be, a cleaner way for one file to know what parent > page was including it. Hmm another nice suggestion. Will add this asap along with your other suggestions, and send you an updated gem. Please be patient till tomorrow though. best regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ak at navel.gr Tue Apr 5 04:38:29 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Tue, 05 Apr 2005 11:38:29 +0300 Subject: [Fwd: Re: [Nitro] Tempalte hack and feature requet] Message-ID: <42524E85.7000503@navel.gr> -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro -------------- next part -------------- An embedded message was scrubbed... From: Anastasios Koutoumanos Subject: Re: [Nitro] Tempalte hack and feature requet Date: Tue, 05 Apr 2005 10:32:51 +0300 Size: 1985 Url: http://rubyforge.org/pipermail/nitro-general/attachments/20050405/bced84ac/attachment.mht From george.moschovitis at gmail.com Tue Apr 5 10:21:43 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 5 Apr 2005 17:21:43 +0300 Subject: [Nitro] What do you think. Message-ID: I planning some changes for the next version, and I would like your opinion: - change Nitro namespace from N to Nitro (to follow the ruby way) - change Glue namespace from N to Glue (to follow the ruby way) The Nitro namespace will by default include the Glue/Og namespaces. The .xhtml extension will be changed to .rx (ruby xml/xhtml) or .sx (server xml/xhtml) Which one do you prefer? I 'll also add an .rxi or .sxi extension for includable templates. Those templates will not be allowed to be accessed as top level templates (for extra security). regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From mneumann at ntecs.de Tue Apr 5 10:35:50 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Tue, 5 Apr 2005 16:35:50 +0200 Subject: [Nitro] What do you think. In-Reply-To: References: Message-ID: <200504051635.50955.mneumann@ntecs.de> Am Dienstag 05 April 2005 16:21 schrieb George Moschovitis: > I planning some changes for the next version, and I would like your > opinion: > > - change Nitro namespace from N to Nitro (to follow the ruby way) > - change Glue namespace from N to Glue (to follow the ruby way) Good idea! > The Nitro namespace will by default include the Glue/Og namespaces. > > The .xhtml extension will be changed to .rx (ruby xml/xhtml) or .sx > (server xml/xhtml) > Which one do you prefer? I'd prefer .rx (or .rxml). Regards, Michael From george.moschovitis at gmail.com Tue Apr 5 10:50:16 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 5 Apr 2005 17:50:16 +0300 Subject: [Nitro] What do you think. In-Reply-To: <200504051635.50955.mneumann@ntecs.de> References: <200504051635.50955.mneumann@ntecs.de> Message-ID: > Good idea! One reason for this change is to make Og more compatible with Wee :) It would not be nice to include the N namespace in wee applications. Glue is more neutral. The main reason is to make using other Ruby projects with Nitro feel more natural. > I'd prefer .rx (or .rxml). ok, other opinions? -g. -- http://nitro.rubyforge.org http://www.joy.gr From ak at navel.gr Tue Apr 5 12:24:02 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Tue, 5 Apr 2005 19:24:02 +0300 Subject: [Nitro] What do you think. In-Reply-To: References: Message-ID: <20050405192402.u821qtldqi9a88os@atlas.navel.gr> > I planning some changes for the next version, and I would like your opinion: > > - change Nitro namespace from N to Nitro (to follow the ruby way) > - change Glue namespace from N to Glue (to follow the ruby way) super! > > The Nitro namespace will by default include the Glue/Og namespaces. > > The .xhtml extension will be changed to .rx (ruby xml/xhtml) or .sx > (server xml/xhtml) > Which one do you prefer? I prefer the xhtml extension - if you must change it though, I prefer .sx .rx reminds me or rexx, some bike models, and is more commonly used than sx (check out http://filext.com/detaillist.php?extdetail=rx&Submit3=Go%21) > > I 'll also add an .rxi or .sxi extension for includable templates. > Those templates will not be allowed to be accessed as top level > templates (for extra security). Nice idea! Tasos > > regards, > George. > > > -- > http://nitro.rubyforge.org > http://www.joy.gr > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > ----- End message from george.moschovitis at gmail.com ----- From mneumann at ntecs.de Tue Apr 5 13:59:53 2005 From: mneumann at ntecs.de (Michael Neumann) Date: Tue, 5 Apr 2005 19:59:53 +0200 Subject: [Nitro] Hello Everyone... In-Reply-To: References: Message-ID: <200504051959.53604.mneumann@ntecs.de> Hi, Am Samstag 02 April 2005 12:52 schrieb Emmanuel Piperakis: > After a lot of thought, deep consideration, and a lot of research on the > topic, I decided to stop the developing of my web app on *r*l* (I promised > a friend I will never use the "r" word again, ..., anyway... , and join > the world of Nitro. What were the reasons for leaving *r*l* ? Just curious. Regards, Michael From george.moschovitis at gmail.com Tue Apr 5 15:52:18 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 5 Apr 2005 22:52:18 +0300 Subject: [Nitro] What do you think. In-Reply-To: <4252BE55.7080208@neurogami.com> References: <4252BE55.7080208@neurogami.com> Message-ID: > 1. I tend to be against any names that presume to be Ruby-standard > rather than app-standard or neutral. So, either .sx or .nx (for Nitro XML) i agree, I like .sx more > I like the idea of using spec-compliant templates, as it opens the door > for validation the templates both before and after rendering. it also > > You would end up with something like this: > > xmlns="http://www.w3.org/1999/xhtml"> > > > > > >> example, if my template is not well-formed XML, does anything in Nitro > break? at the moment only if you use XSLT stylesheets (the parser expects a valid xml file). > .sxi is an extension used by OpenOffice Impress. thanks for pointing this out. > What difference does the extension name have on processing? For > example, if a template (foo.sx) references another file, bar.sx, does it > handle it differently if the file were named bar.rxi or bar.txt? > ... > Do you mean they cannot live under public/ ? no i mean you can ONLY include .sxi templates in .sx templates. Ie if you have a file named myaction.sxi you cannot acces it with http://www.mysite.com/myaction. Only files with .sx extension will be allowed by the dispatcher. .sxi files will be only included. -g. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Tue Apr 5 16:33:26 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 05 Apr 2005 13:33:26 -0700 Subject: [Nitro] What do you think. In-Reply-To: References: <4252BE55.7080208@neurogami.com> Message-ID: <4252F616.7090701@neurogami.com> George Moschovitis wrote: ... >>>example, if my template is not well-formed XML, does anything in Nitro >> >>break? > > > at the moment only if you use XSLT stylesheets (the parser expects a > valid xml file). I see. Haven't tried that yet. > ... > no i mean you can ONLY include .sxi templates in .sx templates. Ie if > you have a file named myaction.sxi you cannot acces it with > http://www.mysite.com/myaction. Only files with .sx extension will be > allowed by the dispatcher. .sxi files will be only included. Oh, nice. Thanks, James From dan at zeraweb.com Tue Apr 5 16:37:41 2005 From: dan at zeraweb.com (Dan Yoder) Date: Tue, 5 Apr 2005 15:37:41 -0500 Subject: [Nitro] What do you think. In-Reply-To: References: Message-ID: <2380d9e6de9158ac8b06cf133a39f5b3@zeraweb.com> My two cents inline below ... On Apr 5, 2005, at 9:21 AM, George Moschovitis wrote: > - change Nitro namespace from N to Nitro (to follow the ruby way) > - change Glue namespace from N to Glue (to follow the ruby way) > > The Nitro namespace will by default include the Glue/Og namespaces. this is all goodness, but i have one comment. is it possible (and i think it is, i just don't recall quite how) to alias the namespaces to N, G, and O? then you could have something like Include NitroShortNamespaces or something. after all, nitro is a fairly significant framework, and it *is* kind of nice to be able to say N::FooBar. it isn't like this is a little utility or something ... =) > The .xhtml extension will be changed to .rx (ruby xml/xhtml) or .sx > (server xml/xhtml) > Which one do you prefer? i am all for sx and sxi (or, if that is used, isx). for one thing, there is no reason the templating needs to be tightly coupled to ruby. sure, if you embed code, it will be ruby code, but that could vary with the platform. in addition, embedded ruby solutions (like JRuby) could still use it anyway, even though the apps are not ruby apps. i think it is more important to shoot for a good templating solution, and the ruby-ness of it is secondary. the reality is that we have to take it one step at a time, but to the extent that the naming should reflect the underlying philosophy behind the design, i would say sx. plus, it's just SeXier. > I 'll also add an .rxi or .sxi extension for includable templates. > Those templates will not be allowed to be accessed as top level > templates (for extra security). this is a very good idea. ~dan From james_b at neurogami.com Tue Apr 5 16:52:15 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 05 Apr 2005 13:52:15 -0700 Subject: [Nitro] File adapter for Og Message-ID: <4252FA7F.5080004@neurogami.com> I'm slowly building up a Nitro tutorial. It starts from the snake-simple, gradually adding in more Nitro features. The premise is that one can start with mocked-out plain HTML, add in some templating, then actual Ruby code, and gradually get more complex, all based on the actual needs of the application. There is no de facto presumption of a database (or any storage, for that matter) until such time that a need is demonstrated. I've yet to get to any mention of Og, but I started thinking about how one might ease into the use of a database, and figured that the file system would make the best first choice. I see there is a FilesysAdapter class, which is sweet. But the comments say it is "proof of concept and at the moment severely limited." What's missing or broken? And what's the forecast? Has anyone used this and can comment on it? Thanks, James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From james_b at neurogami.com Tue Apr 5 16:52:32 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 05 Apr 2005 13:52:32 -0700 Subject: [Nitro] File adapter for Og Message-ID: <4252FA90.6000909@neurogami.com> I'm slowly building up a Nitro tutorial. It starts from the snake-simple, gradually adding in more Nitro features. The premise is that one can start with mocked-out plain HTML, add in some templating, then actual Ruby code, and gradually get more complex, all based on the actual needs of the application. There is no de facto presumption of a database (or any storage, for that matter) until such time that a need is demonstrated. I've yet to get to any mention of Og, but I started thinking about how one might ease into the use of a database, and figured that the file system would make the best first choice. I see there is a FilesysAdapter class, which is sweet. But the comments say it is "proof of concept and at the moment severely limited." What's missing or broken? And what's the forecast? Has anyone used this and can comment on it? Thanks, James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From dan at zeraweb.com Tue Apr 5 17:08:05 2005 From: dan at zeraweb.com (Dan Yoder) Date: Tue, 5 Apr 2005 16:08:05 -0500 Subject: [Nitro] File adapter for Og In-Reply-To: <4252FA7F.5080004@neurogami.com> References: <4252FA7F.5080004@neurogami.com> Message-ID: I would like to stress how badly needed this kind of documentation is ... i realize, of course, that i am stating the obvious, and the equally obvious response is to do like james and write some of it. unfortunately, i don't have the time (at least right now) to do this, and the lack of documentation is making it difficult to make progress with nitro. so what i am wondering is where is this on the agenda? what is the estimated time frame for this? are there other folks working actively on documentation? is there a to do list? again, please understand this is in NO WAY meant to slam the current effort. g & co are doing great work moving this forward and it is great to see the activity on the list picking up. i am just asking the questions to try and better understand where we are at. =) ~dan p.s. one thought i have is a similar tutorial in the spirit of what james is doing, but converting a rails app to nitro. this could also address why you might want to do such a thing. =) i could potentially write or contribute to this, since that is a big part of my struggle. p.p.s. another rails-related thought: i think a lot of the documentation for rails is actually pretty weak. there is plenty of it, but some of it is badly out of date and there are a lot of really basic kinds of things that are not addressed well. i think a really strong set of tutorials and cookbooks could really help nitro's adoption. On Apr 5, 2005, at 3:52 PM, James Britt wrote: > I'm slowly building up a Nitro tutorial. It starts from the > snake-simple, gradually adding in more Nitro features. The premise is > that one can start with mocked-out plain HTML, add in some templating, > then actual Ruby code, and gradually get more complex, all based on > the actual needs of the application. There is no de facto presumption > of a database (or any storage, for that matter) until such time that a > need is demonstrated. > > I've yet to get to any mention of Og, but I started thinking about how > one might ease into the use of a database, and figured that the file > system would make the best first choice. I see there is a > FilesysAdapter class, which is sweet. But the comments say it is > "proof of concept and at the moment severely limited." > > What's missing or broken? And what's the forecast? > > Has anyone used this and can comment on it? > > Thanks, > > > James > > -- > > http://www.ruby-doc.org > http://www.rubyxml.com > http://catapult.rubyforge.com > http://orbjson.rubyforge.com > http://ooo4r.rubyforge.com > http://www.jamesbritt.com > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From james_b at neurogami.com Tue Apr 5 17:56:27 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 05 Apr 2005 14:56:27 -0700 Subject: [Nitro] File adapter for Og In-Reply-To: References: <4252FA7F.5080004@neurogami.com> Message-ID: <4253098B.9090404@neurogami.com> Dan Yoder wrote: > I would like to stress how badly needed this kind of documentation is > ... i realize, of course, that i am stating the obvious, and the equally > obvious response is to do like james and write some of it. > unfortunately, i don't have the time (at least right now) to do this, > and the lack of documentation is making it difficult to make progress > with nitro. Truth is, I started writing the tutorial to help me use Nitro. Writing helps me think; if you want to know want you really think or know about something, try writing it down. > > so what i am wondering is where is this on the agenda? what is the > estimated time frame for this? are there other folks working actively on > documentation? is there a to do list? I'm getting close to sending something off to George. It does not cover all aspects of Nitro; I don't even know what that would entail. The goals of the tutorial are to encourage use of Nitro, and demonstrate a methodology of design and development facilitated by Nitro. I decided to send time with Nitro for variety of reasons: curiosity; disgust with the prevalent "Mine's bigger" pissing contest driven by many in the Rails community (and little apparent interest from anyone in toning it down or reigning it in); a suspicion that Nitro did in fact offer a valuable alternative to Rails. Hopefully, my doc will clarify that last point. Rails has some great features, stuff worth stealing to be sure. But it presumes an awful lot about your application design process and architecture. I might very well be wrong; Rails is remarkably complex, so for all I know it has a way to do everything I see in Nitro, but so far I haven't found it. > > again, please understand this is in NO WAY meant to slam the current > effort. g & co are doing great work moving this forward and it is great > to see the activity on the list picking up. i am just asking the > questions to try and better understand where we are at. =) Lots to do. We have the mixed blessing of working with a framework still in progress. The nice thing is that there is time to change things before they get to entrenched. For those playing along at home, here are some possible ways to contribute: * Post to the list when you find something unclear or unintuitive. Sometimes simply changing the name of something can be a big step, but users need to speak up * Write docs for methods you understand. If you look at the rdoc for Nitro you find very few comments. The method names aren't, to me, immediately self-explanatory. If you've used something and think you've gained some insight, offer up an rdoc comment for the method. * Write simple examples that highlight one or two features. > > ~dan > > p.s. one thought i have is a similar tutorial in the spirit of what > james is doing, but converting a rails app to nitro. this could also > address why you might want to do such a thing. =) i could potentially > write or contribute to this, since that is a big part of my struggle. Sound nice. BTW, I really hope not to see any (well, too much) Rails sniping here. I've used it, I've made money off it, there are many good, smart people working on it. But it may not be suited for all cases, and people should have and understand the alternatives. It would be nice if you wrote up some guidelines or lessons learned from Rails porting. > > p.p.s. another rails-related thought: i think a lot of the documentation > for rails is actually pretty weak. there is plenty of it, but some of it > is badly out of date and there are a lot of really basic kinds of things > that are not addressed well. i think a really strong set of tutorials > and cookbooks could really help nitro's adoption. Docs is hard! Especially as things change. Nitro docs I wrote this morning are out of date. Code samples really help. Here's a thought: Is there am automated tool that lets you store a set of code samples, unit test them, then publish them as HTML, with annotation indicating if a sample failed any tests? As Nitro/Og progresses, the cookbook would be run against the latest versions, and any out-of-date samples flagged. I hate copying code, trying out, having it fail, only to learn that it will never work with the current version. On a related note, my tutorial has, so far, made no mention of unit testing. I'm planning on suggesting that code of any complexity should be encapsulated into clearly defined classes that are easy to test independent of the Nitro environment; you shouldn't have to run a server to test the code. Any thoughts on Nitro/Og unit testing? James From james_b at neurogami.com Tue Apr 5 19:50:30 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 05 Apr 2005 16:50:30 -0700 Subject: [Nitro] File adapter for Og In-Reply-To: References: <4252FA7F.5080004@neurogami.com> Message-ID: <42532446.6090604@neurogami.com> Dan Yoder wrote: > I would like to stress how badly needed this kind of documentation is > ... i realize, of course, that i am stating the obvious, and the equally > obvious response is to do like james and write some of it. > unfortunately, i don't have the time (at least right now) to do this, > and the lack of documentation is making it difficult to make progress > with nitro. Truth is, I started writing the tutorial to help me use Nitro. Writing helps me think; if you want to know want you really think or know about something, try writing it down. > > so what i am wondering is where is this on the agenda? what is the > estimated time frame for this? are there other folks working actively on > documentation? is there a to do list? I'm getting close to sending something off to George. It does not cover all aspects of Nitro; I don't even know what that would entail. The goals of the tutorial are to encourage use of Nitro, and demonstrate a methodology of design and development facilitated by Nitro. Essentially, I had no good idea of where to start with Nitro. The tutorial fixes that. I decided to send time with Nitro for variety of reasons: curiosity; disgust with the prevalent "Mine's bigger" pissing contest driven by many in the Rails community (and little apparent interest from anyone in toning it down or reigning it in); a suspicion that Nitro did in fact offer a valuable alternative to Rails. Hopefully, my doc will clarify that last point. Rails has some great features, stuff worth stealing to be sure. But it presumes an awful lot about your application design process and architecture. I might very well be wrong; Rails is complex, so for all I know it has a way to do everything I see in Nitro, but so far I haven't found it. > > again, please understand this is in NO WAY meant to slam the current > effort. g & co are doing great work moving this forward and it is great > to see the activity on the list picking up. i am just asking the > questions to try and better understand where we are at. =) Lots to do. We have the mixed blessing of working with a framework still in progress. The nice thing is that there is time to change things before they get to entrenched. For those playing along at home, here are some possible ways to contribute: * Post to the list when you find something unclear or unintuitive. Sometimes simply changing the name of something can be a big step, but users need to speak up. * Write docs for methods you understand. If you look at the rdoc for Nitro you find very few comments. The method names aren't, to me, immediately self-explanatory. If you've used something and think you've gained some insight, offer up an rdoc comment for the method. * Write simple examples that highlight one or two features. For example, my tutorial shows conditional render of a common header file by using the new @parent_action_name. Nothing earth-shattering, but simple and useful, both for accomplishing a task and demonstrating syntax. > > ~dan > > p.s. one thought i have is a similar tutorial in the spirit of what > james is doing, but converting a rails app to nitro. this could also > address why you might want to do such a thing. =) i could potentially > write or contribute to this, since that is a big part of my struggle. Sound nice. BTW, I really hope not to see any (well, too much) Rails sniping here. I've used it, I've made money off it, there are many good, smart people working on it. But it may not be suited for all cases, and people should have, and understand, alternatives. It would be nice if you wrote up some guidelines or lessons learned from Rails porting. > > p.p.s. another rails-related thought: i think a lot of the documentation > for rails is actually pretty weak. there is plenty of it, but some of it > is badly out of date and there are a lot of really basic kinds of things > that are not addressed well. i think a really strong set of tutorials > and cookbooks could really help nitro's adoption. Docs is hard! Especially as things change. The Nitro docs I wrote this morning are out of date. Code samples really help. Here's a thought: Is there am automated tool that lets you store a set of code samples, unit test them, then publish them as HTML, with annotation indicating if a code sample failed any tests? As Nitro/Og progresses, the cookbook would be run against the latest versions, and any out-of-date samples flagged. I hate copying code, trying out, having it fail, only to learn that it will never work with the current version. On a related note, my tutorial has, so far, made no mention of unit testing. I'm planning on suggesting that code of any complexity should be encapsulated into clearly defined classes that are easy to test independent of the Nitro environment; you shouldn't have to run a server to test the code. Any thoughts on Nitro/Og unit testing? James From epiperak at softlab.ece.ntua.gr Tue Apr 5 22:45:08 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 6 Apr 2005 05:45:08 +0300 (EEST) Subject: [Nitro] To Nitro In Vitro! Message-ID: To answer to all the posed questions, and enlight the situation I would have to say: 1) Tasos: I am Greek ;-) but located in Japan/Tokyo. Except for my current University research topics I am also working for a real estate consulting company for which I am building a Online Reporting System. 2) Michael: For the beforementioned System, r*i*s has proven inadequate in many ways. Yet I am not a person who looks down on other peoples work, and this in not a *a*l* list so, no comments here. 3) George: I can not help it and get reminded of SEX with .sx ! Therefore... good choice! (GUDOCHO as we say here in Tokyo = latest slang meaning Good Choice!!!) 4) James: I am also working on a small tutorial. My approach is kind of different. Let me explain: not all of us are HTML/XML/XSL/WEB/RUBY gurus. Some common mortals from other fields of science feel the need (the need for speed! => Nitro) to "blog" their way into the web. Sometimes simple apps, sometimes complicated reporting systems, force us to develop an publish online. In that case, personaly, and I believe I speak for most research/developers (or light-developers as I like calling us), we need a tool that help us put our app online. Nitro is THE tool. Why? Because it has not a restricted mentality of use: "No, I do not need to post messages, and make mailing lists!" But, I also do not want to spend weeks on XML/HTML/RUBY...(the list goes on and on). So, (finally a conclussion ..), with Georges' help, I will try to write the Dummys' Tutorial to Nitro, for people who want to spend time on nothing but their app. My time is also limited, but by combining a long list of Q&As the tutorial will soon come to life (soon => 1 or 2 months). In G. we trust! ;-) Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Wed Apr 6 02:25:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 6 Apr 2005 09:25:52 +0300 Subject: [Nitro] What do you think. In-Reply-To: <2380d9e6de9158ac8b06cf133a39f5b3@zeraweb.com> References: <2380d9e6de9158ac8b06cf133a39f5b3@zeraweb.com> Message-ID: > this is all goodness, but i have one comment. is it possible (and i > think it is, i just don't recall quite how) to alias the namespaces to > N, G, and O? then you could have something like Include > NitroShortNamespaces or something. after all, nitro is a fairly > significant framework, and it *is* kind of nice to be able to say > N::FooBar. it isn't like this is a little utility or something ... =) As you can see in the source code, Nitro promotes the usage of FooBar instead of N::FooBar. So there will be no change. Og and Glue will be inteligently included in Nitro so that you can always write FooBar instead of Og::FooBar or Glue::FooBar. Btw, I dont know how to alias Nitro, Og, Glue etc... to N, O, G If you have any idea, tell me :) > > one step at a time, but to the extent that the naming should reflect > the underlying philosophy behind the design, i would say sx. plus, it's > just SeXier. Yeah, this is the extension of our current framework (netrino) and it is pronnounced .SeX pages :) -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 6 02:32:28 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 6 Apr 2005 09:32:28 +0300 Subject: [Nitro] File adapter for Og In-Reply-To: <4252FA7F.5080004@neurogami.com> References: <4252FA7F.5080004@neurogami.com> Message-ID: > What's missing or broken? And what's the forecast? I plan to finish this adapter. In short, it works like this: Classes are mapped to directories and Objects (instances) are mapped to files. At the moment you can't do much querying. But I may be able to fix something when I find some time. However, everyone is invited to have a look at the current code and finish this. But I plan to do some refactoring in the Og (and Nitro) code. I want to make the code cleaner and easier to work with, understand and adapt. So if you see that something could be better implemented with Og (for example a place where eval is not necessary, duplication of code, etc) please let me know. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 6 02:38:20 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 6 Apr 2005 09:38:20 +0300 Subject: [Nitro] File adapter for Og In-Reply-To: References: <4252FA7F.5080004@neurogami.com> Message-ID: > so what i am wondering is where is this on the agenda? what is the > estimated time frame for this? are there other folks working actively > on documentation? is there a to do list? Of course this is on the agenda. I plan to do some refactoring on the code for 0.16.0 and then try to write some documentation for 0.17.0 Hopefully James will finish his tutorial earlier though. I also plan to make some videos (but first I need to implement some more stuff in the scaffolder). But you understand that any help on this matter is greatly appreciated. Firstly I don't have much time either (and Nitro takes almost all of my free time). And Secondly I am not a native speaker either :( > address why you might want to do such a thing. =) i could potentially > write or contribute to this, since that is a big part of my struggle. Please, If you can do this this would be great. I doesn't have to be a long text, It could be just a Blog entry. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 6 02:43:06 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 6 Apr 2005 09:43:06 +0300 Subject: [Nitro] File adapter for Og In-Reply-To: <4253098B.9090404@neurogami.com> References: <4252FA7F.5080004@neurogami.com> <4253098B.9090404@neurogami.com> Message-ID: > I'm getting close to sending something off to George. It does not cover > all aspects of Nitro; I don't even know what that would entail. The > goals of the tutorial are to encourage use of Nitro, and demonstrate a > methodology of design and development facilitated by Nitro. Great, thanks a lot. > Lots to do. We have the mixed blessing of working with a framework > still in progress. The nice thing is that there is time to change > things before they get to entrenched. Yeap, I think this is the number one reason to investigate Nitro at this moment. > * Post to the list when you find something unclear or unintuitive. > Sometimes simply changing the name of something can be a big step, but > users need to speak up This is very important. > Sound nice. BTW, I really hope not to see any (well, too much) Rails > sniping here. I've used it, I've made money off it, there are many Of course not, we are all Ruby enthusiasts. We are coopetitors not competitors. > Docs is hard! Especially as things change. Nitro docs I wrote this > .. > I hate copying code, trying out, having it fail, only to learn that it > will never work with the current version. great idea. > On a related note, my tutorial has, so far, made no mention of unit > testing. I'm planning on suggesting that code of any complexity should > be encapsulated into clearly defined classes that are easy to test > independent of the Nitro environment; you shouldn't have to run a server > to test the code. Any thoughts on Nitro/Og unit testing? support for unit/functional testing will be included out of the box in 0.16.0 :) You simply CANNOT code an application in Ruby without Unit testing. -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 6 02:45:14 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 6 Apr 2005 09:45:14 +0300 Subject: [Nitro] To Nitro In Vitro! In-Reply-To: References: Message-ID: > So, (finally a conclussion ..), with Georges' help, I will try to write > the Dummys' Tutorial to Nitro, for people who want to spend time on > nothing but their app. Thanks Emmanuel, I 'll help you as much as I can. Can't wait for the finished document. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From paulha at aracnet.com Wed Apr 6 21:47:05 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Wed, 06 Apr 2005 18:47:05 -0700 Subject: [Nitro] Trouble opening MySQL database on Win32 Message-ID: <42549119.6040006@aracnet.com> When I try to install the mysql gem, I get the following error: C:\Documents and Settings\phanchet\Desktop>gem install mysql >junk.txt ERROR: While executing gem ... (RuntimeError) ERROR: Failed to build gem native extension. Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.5.1 fo r inspection. ruby extconf.rb install mysql\nchecking for mysql_query() in mysqlclient.lib.. . no checking for main() in m.lib... yes checking for mysql_query() in mysqlclient.lib... no checking for main() in z.lib... no checking for mysql_query() in mysqlclient.lib... no checking for main() in socket.lib... no checking for mysql_query() in mysqlclient.lib... no checking for main() in nsl.lib... no checking for mysql_query() in mysqlclient.lib... no Results logged to c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.5.1/gem_make.out How do I fix it? Og is unhappy with me... Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050406/032ce07b/attachment.html From james_b at neurogami.com Thu Apr 7 00:29:22 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 06 Apr 2005 21:29:22 -0700 Subject: [Nitro] Trouble opening MySQL database on Win32 In-Reply-To: <42549119.6040006@aracnet.com> References: <42549119.6040006@aracnet.com> Message-ID: <4254B722.9000408@neurogami.com> PAUL HANCHETT wrote: > When I try to install the mysql gem, I get the following error: > > C:\Documents and Settings\phanchet\Desktop>gem install mysql >junk.txt > ERROR: While executing gem ... (RuntimeError) > ERROR: Failed to build gem native extension. The gem expects to find a complier so it can compile C code into some native binary. You may be better off just using the pure-Ruby MySQL lib. See http://rubyurl.com/LA3Yv AKA http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/136505 James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From epiperak at softlab.ece.ntua.gr Thu Apr 7 00:47:00 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Thu, 7 Apr 2005 07:47:00 +0300 (EEST) Subject: [Nitro] The Newbie! Q0-Q10 In-Reply-To: <42549119.6040006@aracnet.com> Message-ID: So here how it all starts! "In the beginning there was chaos. And then G. (G. stands for George, or Dr G., I like that, it has a reference to God, or the "G" spot!!) decided to sit down and code Nitro... After a couple of days G. stopped, looked at Nitro and saw that it was GOOD! And G. was pleased, and rested..." And then the newbie came along and said: (Some of the questions are explained in the Nitro API documentaion, and some seam very simple for experienced users, but for the sake of newbies, simple concise answers will suffice, eg. Q8 => A8: .rb is a Ruby executable file. Using the command "ruby filename.rb" we run the file.) Q0: To Nitro? or Not to Nitro? (in Vitro...) Q1: What is Nitro in one sentence? Q2: What could it be used for? Show me an example (URL?). Q3: What programming language was it written with? Q4: What should I know in order to be able to use Nitro? (Ruby? Html? Xml? Xsl? SQL? General Web application developing?) Q5: Could you point me in a basic tutorial, or quick reference for each of the previously mentioned prerequirements (URLs) [I will provide this by myslef ;-)] Q6: Where do I start: Download, Install, Check Install. Q7: Walk me through the nitro package. What is each directory needed for? Are directory names specifics? Could I change them? Q8: What is an .rb file? What is .xhtml .xsl ? Which ones do I use? Q9: HelloWorld? Is there an example? Q10: Ok! I see the example, I run it, but I do not understand what is happening. Could you explain the execution cycle of a small application like the HelloWorld? E.g when I do: "ruby run.rb" what happens? Q0: is a rhetorical question. A0: The answer is of course "To Nitro" ;-) G. waiting for your feedback. Ps. And this is merely the beginning... Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From paulha at aracnet.com Thu Apr 7 01:28:01 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Wed, 06 Apr 2005 22:28:01 -0700 Subject: [Nitro] Trouble opening MySQL database on Win32 In-Reply-To: <4254B722.9000408@neurogami.com> References: <42549119.6040006@aracnet.com> <4254B722.9000408@neurogami.com> Message-ID: <4254C4E1.9080505@aracnet.com> Thanks James, that did the trick. The URL's aren't quite right anymore though... James Britt wrote: > PAUL HANCHETT wrote: > > When I try to install the mysql gem, I get the following error: > > > > C:\Documents and Settings\phanchet\Desktop>gem install mysql > >junk.txt > > ERROR: While executing gem ... (RuntimeError) > > ERROR: Failed to build gem native extension. > > > The gem expects to find a complier so it can compile C code into some > native binary. > > You may be better off just using the pure-Ruby MySQL lib. > > See > > http://rubyurl.com/LA3Yv > > AKA > http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/136505 > > James > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050407/a4c24240/attachment.html From kostas at nasis.com Thu Apr 7 01:31:51 2005 From: kostas at nasis.com (Kostas Nasis) Date: Thu, 07 Apr 2005 01:31:51 -0400 Subject: [Nitro] File adapter for Og In-Reply-To: <4252FA90.6000909@neurogami.com> References: <4252FA90.6000909@neurogami.com> Message-ID: <4254C5C7.70300@nasis.com> James Britt wrote: > I'm slowly building up a Nitro tutorial. It starts from the > snake-simple, gradually adding in more Nitro features. The premise is > that one can start with mocked-out plain HTML, add in some templating, > then actual Ruby code, and gradually get more complex, all based on > the actual needs of the application. There is no de facto presumption > of a database (or any storage, for that matter) until such time that a > need is demonstrated. I would like to help with this. Have you written something already that you can send me? Perhaps we can divide the work, or I can at least serve as a reviewer. Kostas From george.moschovitis at gmail.com Thu Apr 7 03:52:47 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 7 Apr 2005 10:52:47 +0300 Subject: [Nitro] Nitro domain Message-ID: Hello everyone, I am about to register a domain for the homepage of Nitro. At the moment, I am thinking of taking: www.nitrohome.org or www.homeofnitro.org Any suggestions for a better domain will be appreciated. thanks, George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Thu Apr 7 04:05:04 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 7 Apr 2005 11:05:04 +0300 Subject: Fwd: [Nitro] The Newbie! Q0-Q10 In-Reply-To: References: <42549119.6040006@aracnet.com> Message-ID: Hello Emmanuel > Q1: What is Nitro in one sentence? Nitro is a web application platform. Nitro uses the Ruby language to inject joy into web development. Nitro allows you to create scalable applications. Scalability means: - scalability on the server. Nitro will provide excellent support for distributed applications. You will be able to simply add one more server and see immediate performance gains. - scalability of algorithms. We try to use O(1) algorithms as much as possible. - scalability of development. Nitro allows you to start with a simple application and scale this along your needs. > Q2: What could it be used for? Show me an example (URL?). Nitro sites will be available shortly. I plan to use it for sites similar to: www.deviantart.com, www.flicker.com However Nitro is extremely useful for small intranet applications. > Q3: What programming language was it written with? Ruby, the programmers best friend. > Q4: What should I know in order to be able to use Nitro? (Ruby? Html? Xml? Ruby and Html are mandatory. However it would be nice to be familiar with the following technologies: CSS, XML, XHTML, Javascript, XSLT, etc... > Q5: Could you point me in a basic tutorial, or quick reference for each of > the previously mentioned prerequirements (URLs) [I will provide this by > myslef ;-)] A tutorial is coming soon. In the meantime, check out the Og tutorial at www.rubygarden.com > Q6: Where do I start: Download, Install, Check Install. Simple: Install Ruby Install RubyGems (this is automatically installed on Windows) run: gem install nitro run: nitro > Q7: Walk me through the nitro package. What is each directory needed for? > Are directory names specifics? Could I change them? You can use any directory structure you like. > Q8: What is an .rb file? What is .xhtml .xsl ? Which ones do I use? .rb contains ruby code. .xhtml contains the server pages (the equivalent of php/asp/jsp) .xsl (used to style your templates, this is optional, but really the most powerful, elegant and standards compliant method to do templating. Thanks to Nitro's implementation its is extremely efficient (in fact it comes for free)) .css (the standard way to style html files) > Q9: HelloWorld? Is there an example? there are many examples. Checkout the examples directory. > Q10: Ok! I see the example, I run it, but I do not understand what is > happening. Could you explain the execution cycle of a small application > like the HelloWorld? E.g when I do: "ruby run.rb" what happens? I 'll come back with this one :) -g. -- http://nitro.rubyforge.org http://www.joy.gr -- http://nitro.rubyforge.org http://www.joy.gr From georgep at phaistosnetworks.gr Thu Apr 7 05:25:08 2005 From: georgep at phaistosnetworks.gr (George E. Papadakis) Date: Thu, 07 Apr 2005 12:25:08 +0300 Subject: [Nitro] Nitro domain In-Reply-To: References: Message-ID: <4254FC74.6080903@phaistosnetworks.gr> www.nitrohq.com gp George Moschovitis wrote: >Hello everyone, > >I am about to register a domain for the homepage of Nitro. At the >moment, I am thinking of taking: > >www.nitrohome.org > >or > >www.homeofnitro.org > >Any suggestions for a better domain will be appreciated. > >thanks, >George. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050407/9221ea8f/attachment.html From ak at navel.gr Thu Apr 7 05:51:21 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 07 Apr 2005 12:51:21 +0300 Subject: [Nitro] Nitro domain In-Reply-To: <4254FC74.6080903@phaistosnetworks.gr> References: <4254FC74.6080903@phaistosnetworks.gr> Message-ID: <42550299.7020809@navel.gr> George E. Papadakis wrote: > www.nitrohq.com > > gp > > > George Moschovitis wrote: > >>Hello everyone, >> >>I am about to register a domain for the homepage of Nitro. At the >>moment, I am thinking of taking: >> >>www.nitrohome.org >> >>or >> >>www.homeofnitro.org >> >>Any suggestions for a better domain will be appreciated. >> >>thanks, >>George. >> >> >> >------------------------------------------------------------------------ > >_______________________________________________ >Nitro-general mailing list >Nitro-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/nitro-general > > www.nitroforge.org www.nitroworld.org www.nitroblast.org ;-) www.gonitro.org www.nitrolab.org www.nitrodev.org www.nitronet.org www.nitro.eu www.joyofnitro.org :-) /ak -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From gm at navel.gr Thu Apr 7 05:56:09 2005 From: gm at navel.gr (George Moschovitis) Date: Thu, 07 Apr 2005 12:56:09 +0300 Subject: [Nitro] Nitro domain In-Reply-To: <42550299.7020809@navel.gr> References: <4254FC74.6080903@phaistosnetworks.gr> <42550299.7020809@navel.gr> Message-ID: <1112867770.3319.36.camel@slude.navel.gr> > www.gonitro.org www.go-nitro.org i like that :) the .com is reserved though :( -g. -- web: http://www.navel.gr tel: +30 210 6898050 fax: +30 210 6898437 From ak at navel.gr Thu Apr 7 05:58:15 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 07 Apr 2005 12:58:15 +0300 Subject: [Nitro] Nitro domain In-Reply-To: <1112867770.3319.36.camel@slude.navel.gr> References: <4254FC74.6080903@phaistosnetworks.gr> <42550299.7020809@navel.gr> <1112867770.3319.36.camel@slude.navel.gr> Message-ID: <42550437.2040305@navel.gr> George Moschovitis wrote: >>www.gonitro.org >> >> > >www.go-nitro.org > >i like that :) the .com is reserved though :( > >-g. > > go-nitro-go.com :-D /ak -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From ak at navel.gr Thu Apr 7 06:06:10 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 07 Apr 2005 13:06:10 +0300 Subject: [Nitro] should we direct replies to the list? Message-ID: <42550612.5060604@navel.gr> i suggest we use the mailman's feature to direct the replies to the mailing list, instead to the original poster. do you aggree? /ak -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From james_b at neurogami.com Thu Apr 7 08:34:30 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 07 Apr 2005 05:34:30 -0700 Subject: [Nitro] should we direct replies to the list? In-Reply-To: <42550612.5060604@navel.gr> References: <42550612.5060604@navel.gr> Message-ID: <425528D6.9000303@neurogami.com> Anastasios Koutoumanos wrote: > i suggest we use the mailman's feature to direct the replies to the > mailing list, instead to the original poster. > > do you agree? Yes. I've been through multiple discussions on other lists over "reply-to munging considered harmful", and while I think I understand the rational for having replies, by default, sent to the original poster rather than the list, 99.99% of the time I want to reply to the list, and have responses to my postings also go to the list. In my mind, I am not receiving messages from George, Mike, per se, but from nitro-general at rubyforge.org, so that is where I want my replies sent. Thanks, James From james_b at neurogami.com Thu Apr 7 08:36:20 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 07 Apr 2005 05:36:20 -0700 Subject: [Nitro] File adapter for Og In-Reply-To: <4254C5C7.70300@nasis.com> References: <4252FA90.6000909@neurogami.com> <4254C5C7.70300@nasis.com> Message-ID: <42552944.3060809@neurogami.com> Kostas Nasis wrote: > James Britt wrote: > >> I'm slowly building up a Nitro tutorial. It starts from the >> snake-simple, gradually adding in more Nitro features. The premise is >> that one can start with mocked-out plain HTML, add in some templating, >> then actual Ruby code, and gradually get more complex, all based on >> the actual needs of the application. There is no de facto presumption >> of a database (or any storage, for that matter) until such time that a >> need is demonstrated. > > > > I would like to help with this. Have you written something already that > you can send me? Perhaps we can divide the work, or I can at least serve > as a reviewer. I've sent a first draft to George. I want to be sure what I have is at least technically correct. After he has a had a chance to comment, I can pass it on for review. Thanks, James From ilias at lazaridis.com Fri Apr 8 11:43:50 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Fri, 08 Apr 2005 18:43:50 +0300 Subject: [Nitro] [OG] - Problems with GEM installation Message-ID: http://www.rubygarden.org/index.cgi/Libraries/og_tutorial.rdoc - On a windows XP machine, i get this: " P:\ruby\jamlang>gem install og P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og Attempting local installation of 'og' Local gem file not found: og*.gem Attempting remote installation of 'og' Updating Gem source index for: http://gems.rubyforge.org ERROR: While executing gem ... (Errno::ECONNREFUSED) ??? ???? ?????? ? ?????????? ????????, ?????? ? ??????????? ?????????? ??? ???????? ??????. - connect(2) " Any suggestions? . -- http://lazaridis.com From george.moschovitis at gmail.com Sat Apr 9 00:54:47 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 9 Apr 2005 07:54:47 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: Seems like there is a problem with your network connection. Try again. regards, George. On Apr 8, 2005 6:43 PM, Ilias Lazaridis wrote: > http://www.rubygarden.org/index.cgi/Libraries/og_tutorial.rdoc > > - > > On a windows XP machine, i get this: > > " > P:\ruby\jamlang>gem install og > > P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og > Attempting local installation of 'og' > Local gem file not found: og*.gem > Attempting remote installation of 'og' > Updating Gem source index for: http://gems.rubyforge.org > ERROR: While executing gem ... (Errno::ECONNREFUSED) > ??? ???? ?????? ? ?????????? ????????, ?????? ? ??????????? > ?????????? ??? ???????? ??????. - connect(2) > " > > Any suggestions? > > . > > -- > http://lazaridis.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Sat Apr 9 01:36:57 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 08 Apr 2005 22:36:57 -0700 Subject: [Nitro] Infinite loop rendering template Message-ID: <425769F9.2080301@neurogami.com> I have a form page, generated straight from a template, that has the action set to action='/post_entry' When i submit the form, it hits the post_entry method on the default controller class (Blog), and then tries to render the matching template file, post_entry.xhtml. So far so goo, no? But it goes into an infinite loop: DEBUG: Transforming 'public/index.xhtml' DEBUG: Compiling action 'public/' DEBUG: Transforming 'public/index.xhtml' DEBUG: Compiling action 'public/' DEBUG: Transforming 'public/index.xhtml' DEBUG: Compiling action 'public/' DEBUG: Transforming 'public/index.xhtml' DEBUG: Compiling action 'public/' Any ideas on what causes this? The method is this def post_entry STDERR.puts( "-- post_entry ") entry = Entry.new( Time.now, request['content'] ) end And the template does little more than include another template for a header, and render properties of the entry variable. I'm puzzled. James From james_b at neurogami.com Sat Apr 9 01:52:56 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 08 Apr 2005 22:52:56 -0700 Subject: [Nitro] Infinite loop rendering template In-Reply-To: <425769F9.2080301@neurogami.com> References: <425769F9.2080301@neurogami.com> Message-ID: <42576DB8.2060801@neurogami.com> James Britt wrote: > I have a form page, generated straight from a template, that has the > action set to action='/post_entry' > > When i submit the form, it hits the post_entry method on the default > controller class (Blog), and then tries to render the matching template > file, post_entry.xhtml. So far so goo, no? > > But it goes into an infinite loop: > > > DEBUG: Transforming 'public/index.xhtml' > DEBUG: Compiling action 'public/' > DEBUG: Transforming 'public/index.xhtml' > DEBUG: Compiling action 'public/' > DEBUG: Transforming 'public/index.xhtml' > DEBUG: Compiling action 'public/' > DEBUG: Transforming 'public/index.xhtml' > DEBUG: Compiling action 'public/' > I've fixed what was , I think, causing the problem; my template called a non-existent variable. I changed 'entry' to '@entry' in the post_entry method, and made sure I used that same var in the template. But that such an error can result in an infinite loop could be a problem anyway. James From ilias at lazaridis.com Sat Apr 9 11:04:09 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 09 Apr 2005 18:04:09 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: George Moschovitis wrote: > On Apr 8, 2005 6:43 PM, Ilias Lazaridis wrote: > >>http://www.rubygarden.org/index.cgi/Libraries/og_tutorial.rdoc >> >>- >> >>On a windows XP machine, i get this: >> >>" >>P:\ruby\jamlang>gem install og >> >>P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og >>Attempting local installation of 'og' >>Local gem file not found: og*.gem >>Attempting remote installation of 'og' >>Updating Gem source index for: http://gems.rubyforge.org >>ERROR: While executing gem ... (Errno::ECONNREFUSED) >> ??? ???? ?????? ? ?????????? ????????, ?????? ? ??????????? >>?????????? ??? ???????? ??????. - connect(2) >>" >> >>Any suggestions? > Seems like there is a problem with your network connection. > Try again. I've tried again, but i've the feeling that i've not install OG: " P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og Attempting local installation of 'og' Local gem file not found: og*.gem Attempting remote installation of 'og' Updating Gem source index for: http://gems.rubyforge.org Successfully installed production_log_analyzer, version 1.1.0 Installing RDoc documentation for production_log_analyzer-1.1.0... " what now? . -- http://lazaridis.com From george.moschovitis at gmail.com Sat Apr 9 12:49:19 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 9 Apr 2005 19:49:19 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: > I've tried again, but i've the feeling that i've not install OG: > > " > P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og > Attempting local installation of 'og' > Local gem file not found: og*.gem > Attempting remote installation of 'og' > Updating Gem source index for: http://gems.rubyforge.org > Successfully installed production_log_analyzer, version 1.1.0 > Installing RDoc documentation for production_log_analyzer-1.1.0... > " > This looks very strange. Seems that you installed production_log_analyzer instead of og. I will have to ask Chad Fowler about this. In the meantime, why dont you try: P:\ruby\jamlang> "c:\ruby\bin\gem" install og or even better P:\ruby\jamlang> gem install og thanks, George, -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Sat Apr 9 12:53:07 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 9 Apr 2005 19:53:07 +0300 Subject: [Nitro] Infinite loop rendering template In-Reply-To: <42576DB8.2060801@neurogami.com> References: <425769F9.2080301@neurogami.com> <42576DB8.2060801@neurogami.com> Message-ID: > I've fixed what was , I think, causing the problem; my template called a > non-existent variable. I changed 'entry' to '@entry' in the post_entry Yeap, only @xxx variables are passed around. (This may change before the 0.16.0 release though). > But that such an error can result in an infinite loop could be a problem > anyway. I dont understand why you got the infinite loop. I 'll try to recreate the problem and fix this, thanks for pointing this out to me. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Sat Apr 9 13:03:56 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 09 Apr 2005 20:03:56 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: George Moschovitis wrote: >>I've tried again, but i've the feeling that i've not install OG: >> >>" >>P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og >>Attempting local installation of 'og' >>Local gem file not found: og*.gem >>Attempting remote installation of 'og' >>Updating Gem source index for: http://gems.rubyforge.org >>Successfully installed production_log_analyzer, version 1.1.0 >>Installing RDoc documentation for production_log_analyzer-1.1.0... >>" >> > > This looks very strange. Seems that you installed > production_log_analyzer instead of og. > I will have to ask Chad Fowler about this. In the meantime, why dont you try: > > P:\ruby\jamlang> "c:\ruby\bin\gem" install og > > or even better > > P:\ruby\jamlang> gem install og I had typed exactly this (which led to the above execution). > thanks, > George, . -- http://lazaridis.com From ilias at lazaridis.com Sun Apr 10 05:49:50 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sun, 10 Apr 2005 12:49:50 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: > http://www.rubygarden.org/index.cgi/Libraries/og_tutorial.rdoc > > - > > On a windows XP machine, i get this: > > " > P:\ruby\jamlang>gem install og > > P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og > Attempting local installation of 'og' > Local gem file not found: og*.gem > Attempting remote installation of 'og' > Updating Gem source index for: http://gems.rubyforge.org > ERROR: While executing gem ... (Errno::ECONNREFUSED) > ??? ???? ?????? ? ?????????? ????????, ?????? ? ??????????? > ?????????? ??? ???????? ??????. - connect(2) > " > > Any suggestions? I've tried "nitro" " P:\ruby\navel>gem install nitro P:\ruby\navel>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install nitro Attempting local installation of 'nitro' Local gem file not found: nitro*.gem Attempting remote installation of 'nitro' Updating Gem source index for: http://gems.rubyforge.org Install required dependency glue? [Yn] y Install required dependency extensions? [Yn] y Install required dependency flexmock? [Yn] y Install required dependency og? [Yn] y Install required dependency ruby-breakpoint? [Yn] y Install required dependency extensions? [Yn] y Install required dependency flexmock? [Yn] y Successfully installed nitro, version 0.15.0 c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:32: warning: already initialized constant EXPR_BEG c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:33: warning: already initialized constant EXPR_MID c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:34: warning: already initialized constant EXPR_END c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:35: warning: already initialized constant EXPR_ARG c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:36: warning: already initialized constant EXPR_FNAME c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:37: warning: already initialized constant EXPR_DOT c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:38: warning: already initialized constant EXPR_CLASS c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:263: warning: already initialized constant TokenDefinitions c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:268: warning: already initialized constant TkReading2Token c:/ruby/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:269: warning: already initialized constant TkSymbol2Token ERROR: While executing gem ... (NameError) uninitialized constant RubyToken::AlreadyDefinedToken " - Still not sure if I got OG correctly. - Can I manyally download "OG" somewhere (standalone, means *not* bundled with nitro)? . -- http://lazaridis.com From george.moschovitis at gmail.com Sun Apr 10 12:10:49 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 10 Apr 2005 19:10:49 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: This seems to work, better. Perhaps you are not using the latest version of Ruby? Have you installed 1.8.2 ? This is the first time I see those warnings. But it seems like nitro is installed. Have a look at the gems directory to find the gems. BTW, the next version of Nitro/Og will have improved gem distributions with less dependencies. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Sun Apr 10 12:41:15 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sun, 10 Apr 2005 19:41:15 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: George Moschovitis wrote: > This seems to work, better. Perhaps you are not using the latest > version of Ruby? > Have you installed 1.8.2 ? yes (1.8.2-14) > This is the first time I see those > warnings. But it seems like nitro is installed. Have a look at the > gems directory to find the gems. I don't like to use gems. I just want to get "OG". "Can I manyally download "OG" somewhere (standalone, means *not* bundled with nitro)?" > BTW, the next version of Nitro/Og will have improved gem distributions > with less dependencies. ok. what is the minimals effort download (not via GEM) to be able to evaluate "OG" (independent of Nitro)? > regards, > George. . -- http://lazaridis.com From craig-duncan at earthlink.net Sun Apr 10 13:19:35 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Sun, 10 Apr 2005 13:19:35 -0400 Subject: [Nitro] Nitro domain In-Reply-To: References: <4258BEC5.10303@earthlink.net> Message-ID: <42596027.3070509@earthlink.net> George Moschovitis wrote: > Hmm how can I buy nitro.org? Any info appreciated. > > thanks, > George. > > >>nitro.org and nitro.net are both squatted on but not really in use. Did you consider >>it likely to be too expensive to try to buy one of those or is the existence of >>nitro.com the impediment? >> >>craig Speaking of the mailing list defaults... i accidentally sent my response (above) only to George. Anyway, i've emailed the contact person for both nitro.org & nitro.net inquiring about their availability and will let you know what the response is. From george.moschovitis at gmail.com Sun Apr 10 13:23:25 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 10 Apr 2005 20:23:25 +0300 Subject: [Nitro] Nitro domain In-Reply-To: <42596027.3070509@earthlink.net> References: <4258BEC5.10303@earthlink.net> <42596027.3070509@earthlink.net> Message-ID: > Speaking of the mailing list defaults... i accidentally sent my response (above) only > to George. Anyway, i've emailed the contact person for both nitro.org & nitro.net > inquiring about their availability and will let you know what the response is. Ok, thanks! About the mailing list defaults, Tasos will fix this tommorow. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Sun Apr 10 13:25:29 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 10 Apr 2005 20:25:29 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: > what is the minimals effort download (not via GEM) to be able to > evaluate "OG" (independent of Nitro)? The minimal effort download uses Gems: gem install og You can also download the .zip version og-0.15.0.zip + glue-0.15.0.zip and follow the instuctions in INSTALL. but you *really* should try the gem. George. -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Sun Apr 10 14:30:57 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sun, 10 Apr 2005 21:30:57 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: George Moschovitis wrote: >>what is the minimals effort download (not via GEM) to be able to >>evaluate "OG" (independent of Nitro)? > > > The minimal effort download uses Gems: > > gem install og > > You can also download the .zip version > > og-0.15.0.zip + glue-0.15.0.zip and follow the instuctions > in INSTALL. ok http://rubyforge.org/frs/?group_id=418 > but you *really* should try the gem. I have tried it - and provided you with the error messages. You should now fix the problem. > George. . -- http://lazaridis.com From ilias at lazaridis.com Sun Apr 10 16:58:47 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sun, 10 Apr 2005 23:58:47 +0300 Subject: [Nitro] [OG] - Making it work with SQLite Message-ID: Which are the steps to make OG work with SQLite? http://www.sqlite.org/ - I would like to be able to keep everything within one folder: http://lazaridis.com/case/persist/index.html#installation How can this be achieved? . -- http://lazaridis.com From craig-duncan at earthlink.net Mon Apr 11 10:04:43 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Mon, 11 Apr 2005 10:04:43 -0400 Subject: [Nitro] Nitro domain In-Reply-To: <42596027.3070509@earthlink.net> References: <4258BEC5.10303@earthlink.net> <42596027.3070509@earthlink.net> Message-ID: <425A83FB.9080202@earthlink.net> craig duncan wrote: > George Moschovitis wrote: > >> Hmm how can I buy nitro.org? Any info appreciated. >> >> thanks, >> George. >> >> >>> nitro.org and nitro.net are both squatted on but not really in use. >>> Did you consider it likely to be too expensive to try to buy one of >>> those or is the existence of nitro.com the impediment? >>> >>> craig I quote: "I think it would be too expensive for you. " from the person who owns the nitro.net name. I really don't (didn't) know anything about the relative price levels of those who play the squatting game. But i think i conveyed to him the idea that we could pay something but not a lot (without mentioning any numbers: ~$100 might be at the outer limits of feasibility but certainly not hundreds of dollars). And so his response indicates, to me, that these sort of people are looking for a return on their investment of maybe 500% or better. Never got a response from nitro.org. Maybe there are actual plans for doing something with that site. Or maybe they don't even bother to respond to someone who isn't talking real money. :-) craig From george.moschovitis at gmail.com Mon Apr 11 10:13:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 11 Apr 2005 17:13:52 +0300 Subject: [Nitro] Nitro domain In-Reply-To: <425A83FB.9080202@earthlink.net> References: <4258BEC5.10303@earthlink.net> <42596027.3070509@earthlink.net> <425A83FB.9080202@earthlink.net> Message-ID: Never mind, www.nitrohq.com is ok for the purpose :) Thanks for trying anyway :) -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Mon Apr 11 10:16:33 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 11 Apr 2005 17:16:33 +0300 Subject: [Nitro] AOP with nitro Message-ID: Hello everyone, I am trying to introduce some AOP concepts in the next version of Nitro. Any suggestion for a good AOP library for ruby? regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Mon Apr 11 12:18:03 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 19:18:03 +0300 Subject: [Nitro] AOP with nitro In-Reply-To: References: Message-ID: George Moschovitis wrote: > Hello everyone, > > I am trying to introduce some AOP concepts in the next version of > Nitro. Any suggestion for a good AOP library for ruby? I've the impression, that ruby does not need any AOP libraries, as it's supports AOP naturally. - Please stabelize/productize the current state of: * OG * Nitro before going on with critical extensions like AOP. This includes the simplification of installation etc. . > regards, > George. . -- http://lazaridis.com From ak at navel.gr Mon Apr 11 12:24:19 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Mon, 11 Apr 2005 19:24:19 +0300 Subject: [Nitro] AOP with nitro In-Reply-To: References: Message-ID: <425AA4B3.6010409@navel.gr> George Moschovitis wrote: >Hello everyone, > >I am trying to introduce some AOP concepts in the next version of >Nitro. Any suggestion for a good AOP library for ruby? > >regards, >George. > > > My opinion is that rather than new features/concepts/etc. we need to freeze the Nitro features, fix the documentation, and only write new code for absolutely necessary missing parts! Tasos -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From george.moschovitis at gmail.com Mon Apr 11 12:26:34 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 11 Apr 2005 19:26:34 +0300 Subject: [Nitro] AOP with nitro In-Reply-To: References: Message-ID: > Please stabelize/productize the current state of: > ... > before going on with critical extensions like AOP. this will help the stabilization. It will re-factor existing code and allow for more code reuse between Nitro + Og. > This includes the simplification of installation etc. Working on this. Regarding installation, just entering gem install nitro works for me. But I am investigating your problems, just be patient. The next version will be much easier to install. -g. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Mon Apr 11 12:42:11 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 11 Apr 2005 09:42:11 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize Message-ID: <425AA8E2.7000204@neurogami.com> Hi all, While trying to get the Og FileSystem adapter working to my liking, I noticed that the other database adapters were making an interesting assumption about client code. There is a method common to all adapters, read_all, that is given a result set 'res' and a class 'klass'. The code (at least in the mysql and sqlite case) does this: obj = klass.new obj.og_read(res) So, if you have a blog application and have marked the BlogEntry class for persistence by Og, the BlogEntry constructor cannot have any mandatory arguments, else read_all fails. I can understand the need to for this; general-purpose code cannot know the arity and details of each and every constructor. But I am unhappy with this solution for two reasons. The first is that part of the appeal og Nitro/Og is that you can build up an application without having to make design decisions based on unknown future needs, or based on the demands and quirks of the framework. I like the idea that I can start with a set of vanilla HTML pages and migrate them to use templates, server code, and a database. I don't have to plan for all that well before I've determined actual business needs. I would much prefer to be able to take a business object class, switch the attr_* calls to prop_* calls, and magically get Og goodness. Being required to define a particular form of 'initialize' method, even when it does not fit in with a preferred design scheme, feels cumbersome. The second objection is that having a constructor that allows for no arguments may mean one can create an object with invalid state. For example, a BlogEntry instance is meaningless and perhaps disruptive if it does not contain, say some content and a date. Ironically, on my first pass at adding code to the filesys adapter I simply used YAML::load to convert the serialized objects back to Ruby. There was no need to invoke a constructor. It was only after looking at how the other adapters did this that I tried the kalss.new approach, and my code broke. The (arguably) weakest adapter has the best tool for object revival. One thought then was that load_all (and similar methods) could take the database results and use them to create a YAML representation of the object, then call YAML::load. I believe that YAML uses binary code under the hood to actually do this, so mimicking the technique may be a problem. But I hope someone can prove me wrong. (Might be worth asking this in the ruby-musing list, where extreme metaprogramming seems to be the norm.) Thoughts? Is it a reasonable concession to ask of developers that Og-persisted objects have to have a certain style of constructor? On a side note, it is of course possible to write a "have it both ways" constructor, which is not a bad idea in itself, but maybe not something people should be forced to do in order to have both Og persistence and argument checking. #--------------------------------------------- class BlogEntry attr_accessor :content, :time , :title def initialize( content = nil, time = nil , title = nil ) @content, @time , @title = content, time , title yield self unless (content || time || title ) raise "All args are required" unless (@content || @time || @title ) end end be = BlogEntry.new( 'This is my entry', Time.now, "Test" ) be2 = BlogEntry.new { |entry| entry.content = "Content" entry.time = Time.now entry.title = "Testing" } def make_it( res, klass ) obj = klass.new { |k| res.each { |prop, val| k.send( "#{prop}=", val) } } end res = { 'content' => "Content", 'time' => Time.now, 'title' => "Testing" } be3 = make_it( res, BlogEntry ) #--------------------------------------------- If there is a requirement that the constructor have no mandatory arguments, perhaps there can also be a requirement that the constructor yield self so that og_read can dynamically set object properties while the initialize method still has an opportunity to do internal validity checks. James From james_b at neurogami.com Mon Apr 11 12:47:52 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 11 Apr 2005 09:47:52 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: <425AA4B3.6010409@navel.gr> References: <425AA4B3.6010409@navel.gr> Message-ID: <425AAA38.6000801@neurogami.com> Anastasios Koutoumanos wrote: > George Moschovitis wrote: > >> Hello everyone, >> >> I am trying to introduce some AOP concepts in the next version of >> Nitro. Any suggestion for a good AOP library for ruby? >> >> regards, >> George. >> >> >> > My opinion is that rather than new features/concepts/etc. we need to > freeze the Nitro features, fix the documentation, and only write new > code for absolutely necessary missing parts! I'm tempted to agree with this, but now is better than later for getting in any worthwhile additions with the least concern for breaking things. If AOP can help simplify the API and object model, such that adding more features does not require API changes, that would be worth waiting for. Depending, of course, and just how long is the wait. I'd would ask, though, that certain naming conventions be nailed down, even if APIs may change. I think, for example, that both Component and Controller classes are really the same thing, and that they may both end up being called something else. And the template file extension names, too, need clarification. James From ilias at lazaridis.com Mon Apr 11 12:43:49 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 19:43:49 +0300 Subject: [Nitro] [OG] - Making it work with SQLite In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: > Which are the steps to make OG work with SQLite? > > http://www.sqlite.org/ can I please have some inforamtion on this? > I would like to be able to keep everything within one folder: > > http://lazaridis.com/case/persist/index.html#installation > > How can this be achieved? > > . > -- http://lazaridis.com From ilias at lazaridis.com Mon Apr 11 12:47:12 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 19:47:12 +0300 Subject: [Nitro] AOP with nitro In-Reply-To: References: Message-ID: George Moschovitis wrote: >>Please stabelize/productize the current state of: >>... >>before going on with critical extensions like AOP. > > this will help the stabilization. It will re-factor existing code and > allow for more code reuse between Nitro + Og. You should postpone the refactoring, which is a problem source. please freeze and make a product. e.g. "gem install og" fails. it is an essential step for the og installation. >>This includes the simplification of installation etc. > > Working on this. Regarding installation, just entering > > gem install nitro > > works for me. But I am investigating your problems, just be patient. > The next version will be much easier to install. I'm waiting already 3 days. But for sure I cannot wait until the next version. > -g. . -- http://lazaridis.com From james_b at neurogami.com Mon Apr 11 13:15:00 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 11 Apr 2005 10:15:00 -0700 Subject: *****SPAM***** Re: [Nitro] AOP with nitro In-Reply-To: References: Message-ID: <425AB094.4@neurogami.com> Ilias Lazaridis wrote: > > e.g. "gem install og" fails. > > it is an essential step for the og installation. What version of gems are you using? On what OS? "gem install og" works fine for me on Win3k, with the ruby 1-click, and gems 0.8.6. Have you tried gem install nitro ? James From ilias at lazaridis.com Mon Apr 11 13:36:28 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 20:36:28 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: [...] > I've tried again, but i've the feeling that i've not install OG: > > " > P:\ruby\jamlang>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install og > Attempting local installation of 'og' > Local gem file not found: og*.gem > Attempting remote installation of 'og' > Updating Gem source index for: http://gems.rubyforge.org > Successfully installed production_log_analyzer, version 1.1.0 > Installing RDoc documentation for production_log_analyzer-1.1.0... > " > > what now? James Britt within another thread: > What version of gems are you using? 0.8.3 (just installed ruby 182-14 bundle) > On what OS? xp pro > "gem install og" works fine for me on Win3k, with the ruby 1-click, and gems 0.8.6. > > Have you tried > gem install nitro ? yes, see within this thread. but: I need "gem install og". . -- http://lazaridis.com From ilias at lazaridis.com Mon Apr 11 13:38:00 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 20:38:00 +0300 Subject: *****SPAM***** Re: [Nitro] AOP with nitro In-Reply-To: <425AB094.4@neurogami.com> References: <425AB094.4@neurogami.com> Message-ID: James Britt wrote: > Ilias Lazaridis wrote: > >> >> e.g. "gem install og" fails. >> >> it is an essential step for the og installation. > > > What version of gems are you using? On what OS? > > "gem install og" works fine for me on Win3k, with the ruby 1-click, and > gems 0.8.6. > > Have you tried > gem install nitro ? see my answer within thread: "[Nitro] [OG] - Problems with GEM installation" . -- http://lazaridis.com From kostas at nasis.com Mon Apr 11 14:09:54 2005 From: kostas at nasis.com (Kostas Nasis) Date: Mon, 11 Apr 2005 18:09:54 +0000 Subject: [Nitro] [OG] - Problems with GEM installation Message-ID: <425abd72599685.74209126@reply.gr> > I've tried again, but i've the feeling that i've not install OG: I've confirmed that "gem install og" does in fact not work with 0.8.3. Do this: cd c:\ruby\bin gem install rubygems-update cd c:\ruby\lib\ruby\gems\1.8\gems\rubygems-update-0.8.10\ ruby setup.rb cd c:\ruby\bin gem -v (You should see 0.8.10) gem install og Og should now be installed. Kostas From ilias at lazaridis.com Mon Apr 11 14:58:09 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 21:58:09 +0300 Subject: [Nitro] [OG] - Problems with GEM installation In-Reply-To: <425abd72599685.74209126@reply.gr> References: <425abd72599685.74209126@reply.gr> Message-ID: Kostas Nasis wrote: >>I've tried again, but i've the feeling that i've not install OG: > > > I've confirmed that "gem install og" does in fact not work with 0.8.3. > > Do this: [steps corrected to minimal neccessary] > gem install rubygems-update > > cd c:\ruby\lib\ruby\gems\1.8\gems\rubygems-update-0.8.10\ > > ruby setup.rb > gem -v > (You should see 0.8.10) > > gem install og > > Og should now be installed. yes, it is. thanks for the precise info. > Kostas . -- http://lazaridis.com From ilias at lazaridis.com Mon Apr 11 15:16:01 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 22:16:01 +0300 Subject: [Nitro] [WEBSITE] - Google Ads on Project Website Message-ID: http://nitro.rubyforge.org/ you should better remove the google ads on the project website. visitors should focus on nitro. . -- http://lazaridis.com From ilias at lazaridis.com Mon Apr 11 16:31:01 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 11 Apr 2005 23:31:01 +0300 Subject: [Nitro] [OG] - Making it work with SQLite In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: > Ilias Lazaridis wrote: > >> Which are the steps to make OG work with SQLite? >> >> http://www.sqlite.org/ > > can I please have some inforamtion on this? The steps were simple (but why has none answered?): download and install sqlite from www.sqlite.org install ruby-sqlite binding: gem install sqlite3 [select latest version from list] - change code from tutorial: db = Og::Database.new( :database => 'test', :adapter => 'sqlite', # was 'psql', :user => 'postgres', :password => 'navelrulez' ) >> I would like to be able to keep everything within one folder: >> >> http://lazaridis.com/case/persist/index.html#installation >> >> How can this be achieved? ? . -- http://lazaridis.com From epiperak at softlab.ece.ntua.gr Mon Apr 11 21:31:13 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 12 Apr 2005 04:31:13 +0300 (EEST) Subject: [Nitro] AOP with nitro In-Reply-To: <425AA4B3.6010409@navel.gr> Message-ID: > > > My opinion is that rather than new features/concepts/etc. we need to > freeze the Nitro features, fix the documentation, and only write new > code for absolutely necessary missing parts! > > Tasos I agree 100% with Tasos. We should make a combined effort. This effort should of course start from G. You should put a bit more documentation on the API (the latest one) and we will start reading the code... I do not see another way... We split the code or something, work in pairs... I believe Tasos is really good at organizing teams and people for cooperative tasks... Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Mon Apr 11 21:38:43 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 12 Apr 2005 04:38:43 +0300 (EEST) Subject: *****SPAM***** Re: [Nitro] AOP with nitro In-Reply-To: <425AB094.4@neurogami.com> Message-ID: > > > > e.g. "gem install og" fails. > > > > it is an essential step for the og installation. > > What version of gems are you using? On what OS? > > "gem install og" works fine for me on Win3k, with the ruby 1-click, and > gems 0.8.6. > > Have you tried > gem install nitro ? > gem install nitro and gem install og work fine on Debian too... (just in case...anybody is asking...) Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From james_b at neurogami.com Mon Apr 11 22:59:14 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 11 Apr 2005 19:59:14 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: References: Message-ID: <425B3982.4050700@neurogami.com> Emmanuel Piperakis wrote: > > gem install nitro > and > gem install og > work fine on Debian too... (just in case...anybody is asking...) I think the issue all along was that an older version of rubygems was too eager with regex matching on gem names, hooking the wrong gem in the process, with no confirmation or offer of alternatives, James From george.moschovitis at gmail.com Tue Apr 12 00:56:25 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 12 Apr 2005 07:56:25 +0300 Subject: [Nitro] AOP with nitro In-Reply-To: <425AAA38.6000801@neurogami.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> Message-ID: > I'm tempted to agree with this, but now is better than later for getting > in any worthwhile additions with the least concern for breaking things. Exactly, and I think this AOP thing will be worth the extra effort. > If AOP can help simplify the API and object model, such that adding more > features does not require API changes, that would be worth waiting for. > Depending, of course, and just how long is the wait. I 'll send you later today some code for review. I have a simple implementation ready. > I'd would ask, though, that certain naming conventions be nailed down, > even if APIs may change. I think, for example, that both Component and > ... > too, need clarification. You are right, trying extra hard to nail these things down. Regarding the template name I don't like .sx after all. It implies [S]erver side and [X]ml, neither of which is mandatory. For example, templates are used by the Mailer subsystem and may not use XML. Any other ideas? How about .t and .ti ? About the Controller-Component thing, it will stay as Controller. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Tue Apr 12 01:01:19 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 12 Apr 2005 08:01:19 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425AA8E2.7000204@neurogami.com> References: <425AA8E2.7000204@neurogami.com> Message-ID: Hello James, the problem is not that serious (as you said you *can* use a constructor with arguments, they should just default to null). However, I 'll try to find a better solution. Of course I 'll really appreciate a patch for this :) best regards, George. On Apr 11, 2005 7:42 PM, James Britt wrote: > > Hi all, > > While trying to get the Og FileSystem adapter working to my liking, I > ... > the initialize method still has an opportunity to do internal validity > checks. -- http://nitro.rubyforge.org http://www.joy.gr From paulha at aracnet.com Tue Apr 12 01:21:17 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Mon, 11 Apr 2005 22:21:17 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> Message-ID: <425B5ACD.6060204@aracnet.com> George Moschovitis wrote: >You are right, trying extra hard to nail these things down. Regarding >the template name I don't like .sx after all. It implies [S]erver side >and [X]ml, neither of which is mandatory. For example, templates are >used by the Mailer subsystem and may not use XML. Any other ideas? How >about .t and .ti ? > > Forgive a dumb question-- What is wrong with the current .xhtml? Will it need to go to a different template processor, or are you just trying to make sure it can be configured to choose the right one? I get confused by a million different extensions, most of them really being the same thing with really minor differences. Babel! Paul From james_b at neurogami.com Tue Apr 12 01:50:31 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 11 Apr 2005 22:50:31 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: <425B5ACD.6060204@aracnet.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> Message-ID: <425B61A7.2020808@neurogami.com> PAUL HANCHETT wrote: >> > Forgive a dumb question-- What is wrong with the current .xhtml? Will > it need to go to a different template processor, or are you just trying > to make sure it can be configured to choose the right one? My concern is that there is no requirement that the files actually be XHTML. They can be anything. The XHTML lead me to think that Nitro was doing something special with regards to XHTML; it doesn't, really, though it will do XSLT transformations given XML. James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From james_b at neurogami.com Tue Apr 12 02:17:03 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 11 Apr 2005 23:17:03 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> Message-ID: <425B67DF.10203@neurogami.com> George Moschovitis wrote: > Hello James, > > the problem is not that serious (as you said you *can* use a > constructor with arguments, they should just default to null). But then your constructor has no way to ensure that the object i ever correctly initialized. That's my concern. The "yield self from initialize" version at least gives the option of coding some validity checks during initialization. > However, I 'll try to find a better solution. Of course I 'll really > appreciate a patch for this :) Ah, well, of course. How abut something like this, for initializing objects: def object_init( klass, vals = {} ) obj = klass.new do |o| until vals.empty? prop, val = *(vals.shift ) o.send( "#{prop}=", val ) end end return obj if vals.empty? vals.each do |prop, val| obj.send( "#{prop}=", val ) end obj end It first tries to populate an object that yields self from 'new' If the block if never called, then the current Og approach is used. This way, existing apps still work, and new apps have the option of using constructors that yield self. James From george.moschovitis at gmail.com Tue Apr 12 08:46:56 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 12 Apr 2005 15:46:56 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425B67DF.10203@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> Message-ID: Hmm, I am not sure, how to integrate this code snippet in Og. Can you please explain this a little bit better? I 'll also try to think on this later today (very difficult to work on nitro/think in the office). regards, George. From james_b at neurogami.com Tue Apr 12 09:54:49 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 12 Apr 2005 06:54:49 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> Message-ID: <425BD329.2010809@neurogami.com> George Moschovitis wrote: > Hmm, I am not sure, how to integrate this code snippet in Og. > > Can you please explain this a little bit better? I 'll also try to > think on this later today (very difficult to work on nitro/think in > the office). In the assorted Og adapters, when read_all is called, the code instantiates an instance of the serialized object, the calls obj.og_read (which sets object properties) res.each do |row| obj = klass.new obj.og_read(row) objects << obj end Perhaps this could be replaced with something that first tries to populate the object by passing a block to klass.new. James From ilias at lazaridis.com Tue Apr 12 10:41:10 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Tue, 12 Apr 2005 17:41:10 +0300 Subject: [Nitro] AOP with nitro In-Reply-To: References: <425AA4B3.6010409@navel.gr> Message-ID: Emmanuel Piperakis wrote: >>My opinion is that rather than new features/concepts/etc. we need to >>freeze the Nitro features, fix the documentation, and only write new >>code for absolutely necessary missing parts! >> >>Tasos > > > I agree 100% with Tasos. We should make a combined effort. This effort > should of course start from G. No exactly. This should of course start from the project-manager, who decides independently if the core developer is in an activity-trap. > You should put a bit more documentation on > the API (the latest one) and we will start reading the code... I do not > see another way... We split the code or something, work in pairs... Splitting the code has benefits, like allowing the team to document, whilst not mindering developers creativity. But I brings some other problems, like the need to merge the branches etc. > I believe Tasos is really good at organizing teams and people for > cooperative tasks... . -- http://lazaridis.com From ak at navel.gr Tue Apr 12 11:45:00 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Tue, 12 Apr 2005 18:45:00 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425BD329.2010809@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> Message-ID: <425BECFC.7070409@navel.gr> James Britt wrote: > George Moschovitis wrote: > >> Hmm, I am not sure, how to integrate this code snippet in Og. >> Can you please explain this a little bit better? I 'll also try to >> think on this later today (very difficult to work on nitro/think in >> the office). > > > > In the assorted Og adapters, when read_all is called, the code > instantiates an instance of the serialized object, the calls > obj.og_read (which sets object properties) > > res.each do |row| > obj = klass.new > obj.og_read(row) > objects << obj > end > > > Perhaps this could be replaced with something that first tries to > populate the object by passing a block to klass.new. Now, that's a great idea, I think it's straight-forward to implement. The only issue that may arise is a performance penalty for first trying to pass the block and then fall back to the original techique. Since nitro is for speed (among other things), we should "join forces" for using the right way of implementing your idea, minimizing this performance penalty. Regards, Tasos > > James > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From james_b at neurogami.com Tue Apr 12 12:29:06 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 12 Apr 2005 09:29:06 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425BECFC.7070409@navel.gr> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425BECFC.7070409@navel.gr> Message-ID: <425BF752.5090202@neurogami.com> Anastasios Koutoumanos wrote: > James Britt wrote: ... >> >> Perhaps this could be replaced with something that first tries to >> populate the object by passing a block to klass.new. > > > Now, that's a great idea, I think it's straight-forward to implement. > The only issue that may arise is a performance penalty for first trying > to pass the block and then fall back to the original techique. Since > nitro is for speed (among other things), we should "join forces" for > using the right way of implementing your idea, minimizing this > performance penalty. In the example code (object_init) , the first part assumes the method takes a block. If that is not true, the block is never called, though the object is created (which has to happen either way). If the block *is* called, the method exits before trying the non-block version. Otherwise, the accessors are invoked on the object. I don't think this is an expensive test; actually, I don't see any extra overhead at all, other than using hash.shift (which may be marginally more expensive than a non-destructive iteration over the hash). It's not as though the block is executed on every call If 'initialize' never calls yield, the block is never executed. So, read_all, in each adapter, might have: res.each do |row| obj = object_init( klass, row ) end Each adapter may have to implement object_init, because each database has a different way of defining a 'row'. James From paulha at aracnet.com Tue Apr 12 12:47:25 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Tue, 12 Apr 2005 09:47:25 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: <425B61A7.2020808@neurogami.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> <425B61A7.2020808@neurogami.com> Message-ID: <425BFB9D.1070800@aracnet.com> Oh, you mean there's no requirement that the files for Nitro be xhtml... I see. But the expectation is that processing the file will result in an html document, right? When I saw xhtml I knew I was looking at an XML style document that should result in html for viewing. I don't think I'd be too quick to abandon that unless there is some *misleading* understanding it creates... Paul James Britt wrote: > PAUL HANCHETT wrote: > >>> >> Forgive a dumb question-- What is wrong with the current .xhtml? >> Will it need to go to a different template processor, or are you just >> trying to make sure it can be configured to choose the right one? > > > My concern is that there is no requirement that the files actually be > XHTML. They can be anything. The XHTML lead me to think that Nitro > was doing something special with regards to XHTML; it doesn't, really, > though it will do XSLT transformations given XML. > > James > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050412/852e5ef5/attachment.html From paulha at aracnet.com Tue Apr 12 12:51:32 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Tue, 12 Apr 2005 09:51:32 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: References: <425AA4B3.6010409@navel.gr> Message-ID: <425BFC94.3090504@aracnet.com> So, who's doing what? I'll take the position of "Interested Observer Who Doesn't Know Much (IOWKoM)". ;-) Ilias Lazaridis wrote: > Emmanuel Piperakis wrote: > >>> My opinion is that rather than new features/concepts/etc. we need to >>> freeze the Nitro features, fix the documentation, and only write new >>> code for absolutely necessary missing parts! >>> >>> Tasos >> >> >> >> I agree 100% with Tasos. We should make a combined effort. This effort >> should of course start from G. > > > No exactly. > > This should of course start from the project-manager, who decides > independently if the core developer is in an activity-trap. > >> You should put a bit more documentation on >> the API (the latest one) and we will start reading the code... I do not >> see another way... We split the code or something, work in pairs... > > > Splitting the code has benefits, like allowing the team to document, > whilst not mindering developers creativity. > > But I brings some other problems, like the need to merge the branches > etc. > >> I believe Tasos is really good at organizing teams and people for >> cooperative tasks... > > > . > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050412/b66fc41a/attachment.html From paulha at aracnet.com Tue Apr 12 12:55:11 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Tue, 12 Apr 2005 09:55:11 -0700 Subject: [Nitro] AOP? Message-ID: <425BFD6F.1050209@aracnet.com> I'm missing something-- AOP == "Aspect Oriented Programming"? Or something else? Looking for a pointer... Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050412/069236f9/attachment.html From james_b at neurogami.com Tue Apr 12 13:08:22 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 12 Apr 2005 10:08:22 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: <425BFB9D.1070800@aracnet.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> <425B61A7.2020808@neurogami.com> <425BFB9D.1070800@aracnet.com> Message-ID: <425C0086.3010406@neurogami.com> PAUL HANCHETT wrote: > Oh, you mean there's no requirement that the files for Nitro be > xhtml... I see. But the expectation is that processing the file will > result in an html document, right? When I saw xhtml I knew I was > looking at an XML style document that should result in html for viewing. > > I don't think I'd be too quick to abandon that unless there is some > *misleading* understanding it creates... There is no assurance that what you'll get is (X)HTML; it all depends on what you happen to put in the template. There is no actual connection to XHTML or HTML, really; it's just text templating. James From paulha at aracnet.com Tue Apr 12 13:27:28 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Tue, 12 Apr 2005 10:27:28 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: <425C0086.3010406@neurogami.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> <425B61A7.2020808@neurogami.com> <425BFB9D.1070800@aracnet.com> <425C0086.3010406@neurogami.com> Message-ID: <425C0500.1060902@aracnet.com> Exactly. Most template based generation is like that, right? I'll vote for xhtml then. :-) James Britt wrote: > PAUL HANCHETT wrote: > >> Oh, you mean there's no requirement that the files for Nitro be >> xhtml... I see. But the expectation is that processing the file >> will result in an html document, right? When I saw xhtml I knew I >> was looking at an XML style document that should result in html for >> viewing. >> >> I don't think I'd be too quick to abandon that unless there is some >> *misleading* understanding it creates... > > > > There is no assurance that what you'll get is (X)HTML; it all depends > on what you happen to put in the template. There is no actual > connection to XHTML or HTML, really; it's just text templating. > > James > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050412/813511c0/attachment.html From james_b at neurogami.com Tue Apr 12 13:51:36 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 12 Apr 2005 10:51:36 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: <425C0500.1060902@aracnet.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> <425B61A7.2020808@neurogami.com> <425BFB9D.1070800@aracnet.com> <425C0086.3010406@neurogami.com> <425C0500.1060902@aracnet.com> Message-ID: <425C0AA8.3010901@neurogami.com> PAUL HANCHETT wrote: > Exactly. Most template based generation is like that, right? I'll > vote for xhtml then. :-) I'll leave it to you, then, to explain to the puzzled (such as myself) why the .xhtml source files are not XHTML, nor do they result in XHTML, and appear to have no actual relation to XHTML. Most general-purpose templating systems use a neutral file extension (e.g. .PHP, .ASP), intended to identify the processing application rather than than any arbitrary output format. James From george.moschovitis at gmail.com Tue Apr 12 14:48:34 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 12 Apr 2005 21:48:34 +0300 Subject: [Nitro] AOP? In-Reply-To: <425BFD6F.1050209@aracnet.com> References: <425BFD6F.1050209@aracnet.com> Message-ID: yeap. On Apr 12, 2005 7:55 PM, PAUL HANCHETT wrote: > I'm missing something-- AOP == "Aspect Oriented Programming"? Or something > else? -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Tue Apr 12 14:51:12 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 12 Apr 2005 21:51:12 +0300 Subject: [Nitro] AOP with nitro In-Reply-To: <425C0AA8.3010901@neurogami.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> <425B61A7.2020808@neurogami.com> <425BFB9D.1070800@aracnet.com> <425C0086.3010406@neurogami.com> <425C0500.1060902@aracnet.com> <425C0AA8.3010901@neurogami.com> Message-ID: I tend to agree with James. I think using .xhtml as the extension was a bit unfortunate. On the positive side, we can still change this to something more neutral :) -g. On Apr 12, 2005 8:51 PM, James Britt wrote: > PAUL HANCHETT wrote: > > Exactly. Most template based generation is like that, right? I'll > > vote for xhtml then. :-) > > I'll leave it to you, then, to explain to the puzzled (such as myself) > why the .xhtml source files are not XHTML, nor do they result in XHTML, > and appear to have no actual relation to XHTML. > > Most general-purpose templating systems use a neutral file extension > (e.g. .PHP, .ASP), intended to identify the processing application > rather than than any arbitrary output format. > > James > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From paulha at aracnet.com Tue Apr 12 16:39:01 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Tue, 12 Apr 2005 13:39:01 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> <425B61A7.2020808@neurogami.com> <425BFB9D.1070800@aracnet.com> <425C0086.3010406@neurogami.com> <425C0500.1060902@aracnet.com> <425C0AA8.3010901@neurogami.com> Message-ID: <425C31E5.9050206@aracnet.com> I bow to my elders! :-) George Moschovitis wrote: >I tend to agree with James. I think using .xhtml as the extension was >a bit unfortunate. >On the positive side, we can still change this to something more neutral :) > >-g. > >On Apr 12, 2005 8:51 PM, James Britt wrote: > > >>PAUL HANCHETT wrote: >> >> >>> Exactly. Most template based generation is like that, right? I'll >>>vote for xhtml then. :-) >>> >>> >>I'll leave it to you, then, to explain to the puzzled (such as myself) >>why the .xhtml source files are not XHTML, nor do they result in XHTML, >>and appear to have no actual relation to XHTML. >> >>Most general-purpose templating systems use a neutral file extension >>(e.g. .PHP, .ASP), intended to identify the processing application >>rather than than any arbitrary output format. >> >>James >>_______________________________________________ >>Nitro-general mailing list >>Nitro-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/nitro-general >> >> >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050412/1782a72f/attachment.html From james_b at neurogami.com Tue Apr 12 16:56:02 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 12 Apr 2005 13:56:02 -0700 Subject: [Nitro] AOP with nitro In-Reply-To: <425C31E5.9050206@aracnet.com> References: <425AA4B3.6010409@navel.gr> <425AAA38.6000801@neurogami.com> <425B5ACD.6060204@aracnet.com> <425B61A7.2020808@neurogami.com> <425BFB9D.1070800@aracnet.com> <425C0086.3010406@neurogami.com> <425C0500.1060902@aracnet.com> <425C0AA8.3010901@neurogami.com> <425C31E5.9050206@aracnet.com> Message-ID: <425C35E2.6050706@neurogami.com> PAUL HANCHETT wrote: > I bow to my elders! :-) Watch your step, you whippersnapper! Damn kids today ... James From george.moschovitis at gmail.com Wed Apr 13 05:16:23 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 13 Apr 2005 12:16:23 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425BD329.2010809@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> Message-ID: > Perhaps this could be replaced with something that first tries to > populate the object by passing a block to klass.new. ok, but where does this block come from? when reading (deserializing) an object from the store (rdbms) I dont want to call the constructor at all. Perhaps there is a method to allocate the object without calling klass.new. I think this was added in 1.8.2 I 'll investigate. -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 13 05:27:47 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 13 Apr 2005 12:27:47 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> Message-ID: > I 'll investigate. Not much to investigate: ri Class#allocate --------------------------------------------------------- Class#allocate class.allocate() => obj ------------------------------------------------------------------------ Allocates space for a new object of _class_'s class. The returned object must be an instance of _class_. so i replaced klass.new with klass.allocate and the initialize method is not called. the object gets correctly restored by og_read, and there are no restirction for your initialize method. What do you think James? I think this solves your problem nicely. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Wed Apr 13 09:35:00 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 13 Apr 2005 06:35:00 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> Message-ID: <425D2004.6080802@neurogami.com> George Moschovitis wrote: >>Perhaps this could be replaced with something that first tries to >>populate the object by passing a block to klass.new. > > > ok, but where does this block come from? In the Og code, as part of the routing that creates an object. The current code lops over a hash of properties/values and uses that to set object values. That assignment can happen in a block. > > when reading (deserializing) an object from the store (rdbms) I dont want > to call the constructor at all. Perhaps there is a method to allocate the object > without calling klass.new. I think this was added in 1.8.2 YAML and Marshal can deserialize without calling the constructor. But there is the question of whether serialization is meant to preserve specific objects, or a set of values, and if deserialzation is meant to recreate previous objects, or create new objects with pre-existing values. If new objects are to be created, then calling initialize is perhaps the better path because it allows for the object to create any required internal state as well as do a sanity check on on the data used. If pre-existing objects are to be used, then one has to guard against other processes altering the database. James From george.moschovitis at gmail.com Wed Apr 13 09:41:40 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 13 Apr 2005 16:41:40 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425D2004.6080802@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D2004.6080802@neurogami.com> Message-ID: > If pre-existing objects are to be used, then one has to guard against > other processes altering the database. I think the constructor should not be called when deserializing the object. An object that is serialized in the database is allready intialized and in the correct state. I think using klass.allocate is the 'right thing', -g. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Wed Apr 13 09:45:16 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 13 Apr 2005 06:45:16 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> Message-ID: <425D226C.7090708@neurogami.com> George Moschovitis wrote: >>I 'll investigate. > > > Not much to investigate: > > ri Class#allocate > > --------------------------------------------------------- Class#allocate > class.allocate() => obj > ------------------------------------------------------------------------ > Allocates space for a new object of _class_'s class. The returned > object must be an instance of _class_. > > > so i replaced klass.new with klass.allocate and the initialize method > is not called. > the object gets correctly restored by og_read, and there are no > restirction for your initialize method. What do you think James? I > think this solves your problem nicely. Class Foo attr_accessors :x, :y def initialize( x=nil, y=nil ) @x=x @y=y @tstamp = Time.now end def create_date @tstamp end end Question: If you do not call Foo.new, how is @tstamp initialized to the time of creation? My main point is that 'initialize' is where an object makes sure it is starting life on the right foot. It is the best place to assure that it has correct, complete, consistent data. If you override calling 'new', then an object may be created with invalid state. James From george.moschovitis at gmail.com Wed Apr 13 09:48:16 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 13 Apr 2005 16:48:16 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425D226C.7090708@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D226C.7090708@neurogami.com> Message-ID: > Question: If you do not call Foo.new, how is @tstamp initialized to the > time of creation? No, I call Foo.new when the object is created: f = Foo.new f.save oid = f.oid then when I reload f: fr = Foo[oid] the read method in Og should NOT call initialize again... It should call Foo.allocate and the fill in the serialized attributes using og_read. This is the correct behaviour I think. -g. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Wed Apr 13 10:35:42 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 13 Apr 2005 07:35:42 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D2004.6080802@neurogami.com> Message-ID: <425D2E3E.2060101@neurogami.com> George Moschovitis wrote: >>If pre-existing objects are to be used, then one has to guard against >>other processes altering the database. > > > I think the constructor should not be called when deserializing the > object. An object that is serialized in the database is allready > intialized and in the correct state. I think using klass.allocate is > the 'right thing', Say I have an application, a blog, and I'm saving BlogEntries to a database. The Nitro application itself may read and write to tables (via Og). But so can other applications; in fact, I want other applications to be able to create or alter data. I see this as a feature. But this open access means potentially invalid data can get in there. When my Nitro app reads data and creates objects, I want to be sure the created objects are well-constructed. What would be the overhead of saving an object's properties as simple data, but also using an extra field to store a YAML serialization, and having a means where client code can either create new objects based on values in the database, or revive existing objects from the saved serialization? I can see where saving whole objects, intact, internal state and all, can be very handy. So far, though, I've been thinking in terms of creating objects when needed, based on stored data. If, in my blog app, I select a set of entries based on date or content, I do not expect to be getting back the same objects as previously created. There are important differences in an application when it's "objects created from table data" versus "objects revived from serialization". James > > -g. > -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From james_b at neurogami.com Wed Apr 13 10:43:56 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 13 Apr 2005 07:43:56 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D226C.7090708@neurogami.com> Message-ID: <425D302C.40700@neurogami.com> George Moschovitis wrote: >>Question: If you do not call Foo.new, how is @tstamp initialized to the >>time of creation? > > > No, I call Foo.new when the object is created: > > f = Foo.new > f.save > oid = f.oid > > then when I reload f: > > fr = Foo[oid] > > the read method in Og should NOT call initialize again... > It should call Foo.allocate and the fill in the serialized attributes > using og_read. > This is the correct behaviour I think. That will not restore or set private variables. f = Foo.allocate p f.create_date # nil James From ilias at lazaridis.com Wed Apr 13 11:35:15 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Wed, 13 Apr 2005 18:35:15 +0300 Subject: [Nitro] [OG] - Please Make a Product / Project Website Message-ID: 2 months before I was here to evaluate nitro, but I stopped the evaluation. Now I'm basicly here for OG. But still I'm not confident, if I should even evaluate it. I saw some people from www.navel.gr joining here, but none cares that the companies website is not up to date (2 years). OG has not even a simple product webpage. Everything seems a little like "fuzzy development" - and I'm not sure if this is the right way to produce a critical software-core, which should handle large amounts of data. Please: * Productize OG (e.g.: own project on rubyforge, website (or section)) * Use user feedback, especially the critical one * Take evaluators "by their hand" and guide them thrugh a evaluation . -- http://lazaridis.com From daniel at bovensiepen.net Wed Apr 13 12:35:53 2005 From: daniel at bovensiepen.net (Daniel Bovensiepen) Date: Wed, 13 Apr 2005 18:35:53 +0200 Subject: [Nitro] is there a 'is_valid_property?' in og? Message-ID: Hi together, I'm searching a valid method which check a given value. I don't want to add the value to the og-object first. what I'm looking for is a method like: myOgObject.is_valid_name?('daniel') => true of course it returns only true if the validate_format from the property 'name' is similarly to /^[\w]{1,20}$/ is there some method which can do this already? or is the only way to check a value calling the 'valid?' method? Mfg daniel From george.moschovitis at gmail.com Wed Apr 13 15:16:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 13 Apr 2005 22:16:48 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425D2E3E.2060101@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D2004.6080802@neurogami.com> <425D2E3E.2060101@neurogami.com> Message-ID: > applications to be able to create or alter data. I see this as a feature. ok... > When my Nitro app reads data and creates objects, I want to be sure the > created objects are well-constructed. you can add a og post-read callback to validate the object. (In the next version this will be much easier and powerful, thanks to the aspects). > What would be the overhead of saving an object's properties as simple > data, but also using an extra field to store a YAML serialization, and > ... > values in the database, or revive existing objects from the saved > serialization? this feels wrong. You are duplicating the data. Plus there is another problem. If you attach a yaml representation to every DBMS row, you cant have constant length records (which are much faster to traverse by the DBMS system). BTW, I think it is wrong to call the initialize method when an object is deserialized. In the initialize method I may put code that should be called when the object is initialized, ie created for the first time. For example I could have code for reference counting in the constructor: def initialize Statistics.num_of_blogs += 1 end It would be bad to force this code executed every time the object was deserialised. If you want to ensure a valid state for your object you could do the following (some 0.16.0 concepts here): class MyObject # 0.16.0 aspect to intercept lifecycle callback post :make_valid, :on => og_read def initialize(...) ... make_valid ... end def make_valid # ensure a valid state for the object end end then make_valid is called after (post) each object is deserialized (read) from the DBMS. does this make sense to you? George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 13 15:17:45 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 13 Apr 2005 22:17:45 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425D302C.40700@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> Message-ID: > f = Foo.allocate > p f.create_date # nil og_read restores f.create_data so it is NOT nil. -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 13 15:20:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 13 Apr 2005 22:20:48 +0300 Subject: [Nitro] is there a 'is_valid_property?' in og? In-Reply-To: References: Message-ID: > myOgObject.is_valid_name?('daniel') > => true Hmm even though the existing .valid? function works great in practice, I 'll try to add the methods you suggest. Thanks for the tip. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Wed Apr 13 17:04:59 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 13 Apr 2005 14:04:59 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> Message-ID: <425D897B.5040900@neurogami.com> George Moschovitis wrote: >>f = Foo.allocate >>p f.create_date # nil > > > og_read restores f.create_data so it is NOT nil. Yes, currently, because og_read calls new. But using allocate in place of new will bypass the initialization of @tstamp Example: class Foo attr_accessor :x, :y def initialize( x=nil, y=nil ) @x = x @y = y @tstamp = Time.new end def create_date @tstamp end end f = Foo.allocate p f.create_date # nil James From james_b at neurogami.com Wed Apr 13 19:05:11 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 13 Apr 2005 16:05:11 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D2004.6080802@neurogami.com> <425D2E3E.2060101@neurogami.com> Message-ID: <425DA5A7.3090307@neurogami.com> George Moschovitis wrote: >>applications to be able to create or alter data. I see this as a feature. > > > ok... > > >>When my Nitro app reads data and creates objects, I want to be sure the >>created objects are well-constructed. > > > you can add a og post-read callback to validate the object. (In the > next version this will be much easier and powerful, thanks to the > aspects). I think the central issue is, How much code has to be changed or added in order to get some sort of persistence and automatic object creation. The other issue is, what is being saved/retrieved: objects or data? > > >>What would be the overhead of saving an object's properties as simple >>data, but also using an extra field to store a YAML serialization, and >>... >>values in the database, or revive existing objects from the saved >>serialization? > > > this feels wrong. You are duplicating the data. Plus there is another > problem. If you attach a yaml representation to every DBMS row, you > cant have constant length records (which are much faster to traverse > by the DBMS system). Yeah, I'm not crazy about the idea. It solves some problems, but it's a hack. > > BTW, I think it is wrong to call the initialize method when an object > is deserialized. In the initialize method I may put code that should > be called when the object is initialized, ie created for the first > time. This is an important issue, though. When a row is retrieved from a table, is it to restore a specific object, or to drive the creation of a new object? The later is not deserialization (to my mind), and leaves open the idea that the data may come from a variety of sources. So, yes, with deserialization one should not be calling the constructor, but objecting to calling 'new' presumes that deserialization, rather than object creation, is the goal. > For example I could have code for reference counting in the > constructor: > > def initialize > Statistics.num_of_blogs += 1 > end > > It would be bad to force this code executed every time the object was > deserialised. > > If you want to ensure a valid state for your object you could do the > following (some 0.16.0 concepts here): > > class MyObject > > # 0.16.0 aspect to intercept lifecycle callback > post :make_valid, :on => og_read > > def initialize(...) > ... > make_valid > ... > end > > def make_valid > # ensure a valid state for the object > end > > end > > then make_valid is called after (post) each object is deserialized (read) from > the DBMS. > > does this make sense to you? Sort of, but not in a way I like. I have this mental model around Nitro/Og, where one can write an application in the simplest form, and not have to commit to design or code idioms mandated by the framework, until such time that the need arises. And when such changes are required, that they are minimal or automatic by virtue of meta-programming. If I'm designing an application, with no presupposition abut what data will be saved, then I'm probably going to build classes with initialize methods designed to enforce constraints. If, later I decide to Oggify some classes, I would prefer to make as few changes as possible. Changing attr_* to prop_* is trivial, and there is a clear need for it. Having to rework the constructor, and add new methods that only make sense when used with Og, seems more burdensome. It may be that, in order to get a fair level of robust O/R, assorted concession have to be made. I just want to be sure they are small. An alternative to using a block to instantiate am object is to require persisted classes to use a hash (i.e. named arguments) as the sole argument, and og_read or whatever would then create this hash from the table data and pass this into new. This still does not allow quite enough freedom in class design; I may want a class that requires certain arguments, but also exposes properties that are only set though methods, not the constructor. So code would still need to call all the attribute setters. For what its worth, I'm somewhat skeptical of saving and restoring objects as objects, rather than creating new objects from saved data, because I think you end up trying to have a virtual object database that has to sit atop assorted relational databases. On the other hand (of course), I'm intrigued by the idea of a framework that completely hides the notion of any relation database underpining; you just code as if all you have are objects, and saving restoring deals with specific objects, not relational data. James From george.moschovitis at gmail.com Thu Apr 14 03:19:53 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 14 Apr 2005 10:19:53 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425D897B.5040900@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425BD329.2010809@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> Message-ID: > > og_read restores f.create_data so it is NOT nil. > Yes, currently, because og_read calls new. But using allocate in place > of new will bypass the initialization of @tstamp no, no... after klass.allocate, og_read is called. og_read SETS the timestamp to the correct value! I have tested this. It works correctly. -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Thu Apr 14 03:30:07 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 14 Apr 2005 10:30:07 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425DA5A7.3090307@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425B67DF.10203@neurogami.com> <425BD329.2010809@neurogami.com> <425D2004.6080802@neurogami.com> <425D2E3E.2060101@neurogami.com> <425DA5A7.3090307@neurogami.com> Message-ID: > The other issue is, what is being saved/retrieved: objects or data? Objects are saved, but objects are ALLREADY intialized. You dont have to initialize the object EVERY time you read the object from the database. > This is an important issue, though. When a row is retrieved from a > table, is it to restore a specific object, or to drive the creation of a it restores a new object. > new object? The later is not deserialization (to my mind), and leaves > open the idea that the data may come from a variety of sources. yeap, this is not deserialization, thats my point. Og does deserialization. your idea is interesting though. But I guess if this other source follows some convention it will work with the existing model. > So, yes, with deserialization one should not be calling the constructor, > but objecting to calling 'new' presumes that deserialization, rather > than object creation, is the goal. yeap deserialization is the goal, i think it makes sense :) > a clear need for it. Having to rework the constructor, and add new > methods that only make sense when used with Og, seems more burdensome. :( I dont understand you. Og now uses klass.allocate, so Og is indifferent to the constructor. you can have any constructor you want. You dont have to make a 'special' constructor for Og. > For what its worth, I'm somewhat skeptical of saving and restoring > objects as objects, rather than creating new objects from saved data, > because I think you end up trying to have a virtual object database that > has to sit atop assorted relational databases. yeap but the relational database is created automatically for you. That thing aside, I plan to add some form of 'reverse engineering' of existing schemas in Og. This is very easy to do. > On the other hand (of course), I'm intrigued by the idea of a framework that > completely hides the notion of any relation database underpining; you just code as if all > you have are objects, and saving restoring deals with specific objects, > not relational data. this is what Og tries to do. BTW, I still have the feeling I dont understand your point correctly. Perhaps we could better discuss this on IRC. How about freenode #nitro_og ?? regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ak at navel.gr Thu Apr 14 03:36:39 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 14 Apr 2005 10:36:39 +0300 Subject: [Nitro] [OG] - Please Make a Product / Project Website In-Reply-To: References: Message-ID: <425E1D87.5000206@navel.gr> Ilias Lazaridis wrote: > 2 months before I was here to evaluate nitro, but I stopped the > evaluation. > > Now I'm basicly here for OG. > > But still I'm not confident, if I should even evaluate it. > > I saw some people from www.navel.gr joining here, but none cares that > the companies website is not up to date (2 years). Yes, this is because we're trying to cope with OG/Nitro development and support of its open source release. We prefer to produce code and implement our desing ideas rather than creating a flashy display for selling our company our ourselves. But you're right, we _deserve_ a better web site and it's on the top of our todo list! enJOY, Tasos > > OG has not even a simple product webpage. > > Everything seems a little like "fuzzy development" - and I'm not sure > if this is the right way to produce a critical software-core, which > should handle large amounts of data. > > Please: > > * Productize OG (e.g.: own project on rubyforge, website (or section)) > * Use user feedback, especially the critical one > * Take evaluators "by their hand" and guide them thrugh a evaluation > > . > -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From james_b at neurogami.com Thu Apr 14 10:31:44 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 14 Apr 2005 07:31:44 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425BD329.2010809@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> Message-ID: <425E7ED0.7050404@neurogami.com> George Moschovitis wrote: >>>og_read restores f.create_data so it is NOT nil. >> >>Yes, currently, because og_read calls new. But using allocate in place >>of new will bypass the initialization of @tstamp > > > no, no... > > after klass.allocate, og_read is called. og_read SETS the timestamp > to the correct value! I have tested this. It works correctly. > > -g. > > Where does og_read get this value? It should hold the value of when the object created (i.e. when populated with database content). Here's my Og version of the example class Foo prop_accessor :x, Integer prop_accessor :y, Integer def initialize( x=nil, y=nil ) @x = x || 0 @y = y || 0 @tstamp = Time.new end def create_date @tstamp end end What value would create_date return after og_read? James From george.moschovitis at gmail.com Thu Apr 14 10:38:10 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 14 Apr 2005 17:38:10 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425E7ED0.7050404@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> Message-ID: > What value would create_date return after og_read? Here is the workflow: f = Foo.new f.tstamp # => Time.now # now lets save this: f.save # => INSERT INTO og_foo (..., tstamp, ...) VALUES (..., TimeStampAsSql, ...) now you read the object back: f = Foo[foo_oid] this calls read_one: read_one first allocates the object: obj = klass.allocate and then calls og_read for the object obj.og_read(res, 0) now you have the correct TimeStamp: f.tstamp # => The original timestamp. am I missing something ? regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ak at navel.gr Thu Apr 14 11:11:06 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 14 Apr 2005 18:11:06 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> Message-ID: <425E880A.2090903@navel.gr> George Moschovitis wrote: >>What value would create_date return after og_read? >> >> > >Here is the workflow: > >f = Foo.new >f.tstamp # => Time.now > ># now lets save this: > >f.save > ># => INSERT INTO og_foo (..., tstamp, ...) VALUES (..., TimeStampAsSql, ...) > >now you read the object back: > >f = Foo[foo_oid] > >this calls read_one: > >read_one first allocates the object: > >obj = klass.allocate > >and then calls og_read for the object > >obj.og_read(res, 0) > >now you have the correct TimeStamp: > >f.tstamp # => The original timestamp. > >am I missing something ? > > i think you're missing the fact that tstamp is just a class variable, not a prop_* variable! james is right in the fact that we should allow for internal class variables to be persisted some way. but you're right saying that initialised should _not_ be used when restoring an object from the backend. /t. >regards, >George. > > > -- Navel Ltd http://www.navel.gr - info at navel.gr - +30 210 6898050 Have fun: www.joy.gr/ and create: www.navel.gr/nitro From paulha at aracnet.com Thu Apr 14 12:03:04 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Thu, 14 Apr 2005 09:03:04 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425E880A.2090903@navel.gr> References: <425AA8E2.7000204@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> <425E880A.2090903@navel.gr> Message-ID: <425E9438.6000304@aracnet.com> Anastasios Koutoumanos wrote: > i think you're missing the fact that tstamp is just a class variable, > not a prop_* variable! > > james is right in the fact that we should allow for internal class > variables to be persisted some way. > > but you're right saying that initialised should _not_ be used when > restoring an object from the backend. So, if you persist a class variable when do you do it? At different times in the life of the class it may have different values which are not related to any instance values saved. It definitely should not be saved and restored as part of any particular instance value! One solution might be to encapsulate class values into a class of their own, and persist *that* class as a singleton. Paul From james_b at neurogami.com Thu Apr 14 12:28:23 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 14 Apr 2005 09:28:23 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425E880A.2090903@navel.gr> References: <425AA8E2.7000204@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> <425E880A.2090903@navel.gr> Message-ID: <425E9A27.3060209@neurogami.com> Anastasios Koutoumanos wrote: >> > i think you're missing the fact that tstamp is just a class variable, > not a prop_* variable! No, it's an instance variable. It's read-only, and not marked for persistence, as the whole point is that it gets instantiated by process, not client assignment. > > james is right in the fact that we should allow for internal class > variables to be persisted some way. I do not want certain instance values saved, as they may be derived data or related to specific circumstances (such as the time a particular instance is created). > > but you're right saying that initialised should _not_ be used when > restoring an object from the backend. I think there is confusion over the use of the word 'restore'. If the idea is to revive a previously-existing object (similar in spirit to YAML.load( yml ), then do not call initialize. If the the idea is use data (which may or may not have come from a previously existing object) to drive the creation of objects, then initialize may be needed because that is where internal state may set up and validity checks performed. If I understand George, any such internal initialization and state validation logic performed at object creation would have to be moved to another method that gets called by Og during og_read. James From james_b at neurogami.com Thu Apr 14 13:13:54 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 14 Apr 2005 10:13:54 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> Message-ID: <425EA4D2.8030701@neurogami.com> George Moschovitis wrote: >>What value would create_date return after og_read? > > > Here is the workflow: > > f = Foo.new > f.tstamp # => Time.now > > # now lets save this: > > f.save > > # => INSERT INTO og_foo (..., tstamp, ...) VALUES (..., TimeStampAsSql, ...) Why is tstamp being saved? Here's a variation: class Foo attr_accessor :x, :y def initialize( x=nil, y=nil ) @x = x @y = y @tstamp = Time.new end def is_too_old? t = Time.now ( t.to_i - @tstamp.to_i > 1000000 ) end end How can @tstamp be saved or set? I believe, then, that under Og, this must become something like: def initialize( x=nil, y=nil ) @x = x @y = y post_og_read end def post_og_read @tstamp = Time.new # maybe also validate values of @x and @y end James From daniel at bovensiepen.net Thu Apr 14 13:25:16 2005 From: daniel at bovensiepen.net (Daniel Bovensiepen) Date: Thu, 14 Apr 2005 19:25:16 +0200 Subject: [Nitro] is there a 'is_valid_property?' in og? In-Reply-To: Message-ID: Maybe i didn't know the complete function of valid.. I just want to check a value against the validate functions in an og object.. If i add all values to the og object and ask the object '.valid?' it returns a list with the errors. Then i can ask something like 'count' and i get the numbers of errors but i didn't get the information -> is this value valid? I only get the info that some property is not valid. Is there a way to check the error-list for a specific property? If yes my problem were solved. Am 13.04.2005 21:20 Uhr schrieb "George Moschovitis" unter : >> myOgObject.is_valid_name?('daniel') >> => true > > Hmm even though the existing .valid? function works great in practice, > I 'll try to add the methods you suggest. Thanks for the tip. > > regards, > George. From george.moschovitis at gmail.com Thu Apr 14 13:59:00 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 14 Apr 2005 20:59:00 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425E9A27.3060209@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> <425E880A.2090903@navel.gr> <425E9A27.3060209@neurogami.com> Message-ID: > No, it's an instance variable. It's read-only, and not marked for > persistence, as the whole point is that it gets instantiated by process, > not client assignment. ok, didn't see that, sorry. > I think there is confusion over the use of the word 'restore'. If the > idea is to revive a previously-existing object (similar in spirit to > YAML.load( yml ), then do not call initialize. Og read is like Yaml.load(). It restores a previously existing object. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Thu Apr 14 13:59:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 14 Apr 2005 20:59:52 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425EA4D2.8030701@neurogami.com> References: <425AA8E2.7000204@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> <425EA4D2.8030701@neurogami.com> Message-ID: class Foo prop_accessor :x, :y # properties to be saved > Here's a variation: > > class Foo > attr_accessor :x, :y > def initialize( x=nil, y=nil ) > @x = x > @y = y > @tstamp = Time.new > end > > def is_too_old? > t = Time.now > ( t.to_i - @tstamp.to_i > 1000000 ) > end > > end > > How can @tstamp be saved or set? > > I believe, then, that under Og, this must become something like: > > def initialize( x=nil, y=nil ) > @x = x > @y = y > post_og_read > end > > def post_og_read > @tstamp = Time.new > # maybe also validate values of @x and @y > end > > James > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Thu Apr 14 14:11:10 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 14 Apr 2005 21:11:10 +0300 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> <425EA4D2.8030701@neurogami.com> Message-ID: Sorry for that, let me try again... class Foo prop_accessor :x, :y # save those attributes attr_accessor :calc # don't save this attribute can be calculated from x,y def initalize(x, y) @x, @y = x, y # i want the mail sent only when creating the object mail('gm at navel.gr', 'Hey, a new foo was created') # lets create a variable from x, y # as it can be calculated there is no need to save this @calc = @x * @y end obviously you dont want to call the initialize method every time the object is read (== deserialized) from the database. But you need to to generate the @calc variable after reading to have a valid Foo object. Og needs some help here. Og cannot decide alone how to skip the mail and just generate calc. So we give Og a hint: class Foo ... post(:on => :og_read) { |this| this.calc = this.x * this.y } # or more efficiently: post "@calc = @x * @y", :on => :og_read end with this tip Og does the following when reading the object: f = Foo.allocate f.og_read where Foo#og_read does the following: def og_read(res) @x = res['x'] @y = res['y'] @calc = @x * @y end please note that Og automatically generates og_read. So you really only need to add one line of code to make Og handle your class. Plus you are free to design the initialize method as you like. Even better I suggest to do some refactoring: class Foo def initialize(x,y) @x, @y = x, y end def do_calc @calc = @x * @y end post :do_calc, :on => [ :initialize, :og_read ] end please note, this uses the AOP features in 0.16.0 -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Thu Apr 14 14:18:09 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 14 Apr 2005 21:18:09 +0300 Subject: [Nitro] is there a 'is_valid_property?' in og? In-Reply-To: References: Message-ID: > Is there a way to check the error-list for a specific property? If yes my > problem were solved. of course: unless user.valid? p user.errors[:name] # or p user.errors.on(:name) end perhaps I should add a method like: p user.valid?(:name) as a helper... -g. -- http://nitro.rubyforge.org http://www.joy.gr From daniel at bovensiepen.net Thu Apr 14 14:23:51 2005 From: daniel at bovensiepen.net (Daniel Bovensiepen) Date: Thu, 14 Apr 2005 20:23:51 +0200 Subject: [Nitro] is there a 'is_valid_property?' in og? In-Reply-To: Message-ID: Oh thats great for the moment.. Thanks a lot.. Am 14.04.2005 20:18 Uhr schrieb "George Moschovitis" unter : >> Is there a way to check the error-list for a specific property? If yes my >> problem were solved. > > of course: > > unless user.valid? > p user.errors[:name] > # or > p user.errors.on(:name) > end > > perhaps I should add a method like: > > p user.valid?(:name) > > as a helper... > > > -g. > From james_b at neurogami.com Thu Apr 14 17:34:34 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 14 Apr 2005 14:34:34 -0700 Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: References: <425AA8E2.7000204@neurogami.com> <425D226C.7090708@neurogami.com> <425D302C.40700@neurogami.com> <425D897B.5040900@neurogami.com> <425E7ED0.7050404@neurogami.com> <425EA4D2.8030701@neurogami.com> Message-ID: <425EE1EA.2020201@neurogami.com> George Moschovitis wrote: > class Foo > prop_accessor :x, :y # properties to be saved Right; I was focusing on code changes needed to do state validation and re-initialization after an og_read, where the code in 'initialize' would not get called. James From ilias at lazaridis.com Thu Apr 14 19:09:44 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Fri, 15 Apr 2005 02:09:44 +0300 Subject: [Nitro] [OG] - Automated table modification / extension Message-ID: I create a class, instantiate an object and save it within an sqlite3. I retrieve this object. [the table was created, and I load the object back] - In the next step, I add a new "property" to the class. I instantiate an new object, and try to save it. but: the save fails with an "field not fould" exception. [the new property i've added] - How do I setup OG that it automaticaly match the table to the updated class-definition? (= automaticly add columns). . -- http://lazaridis.com From epiperak at softlab.ece.ntua.gr Thu Apr 14 21:38:25 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 15 Apr 2005 04:38:25 +0300 (EEST) Subject: [Nitro] Concerns over Og mandating the form of initialize In-Reply-To: <425E9A27.3060209@neurogami.com> Message-ID: > > If the the idea is use data (which may or may not have come from a > previously existing object) to drive the creation of objects, then > initialize may be needed because that is where internal state may set up > and validity checks performed. I believe I understand. Lets say I use Nitro to make a DB, then edit the DB outside Nitro, with lets say phpMyAdmin, or directly with SQL and I add a column, or a new table to my DB, then run my Nitro application again. What happens then... (rough example)...? James I understand your concerns. My reply would be that the "Nitro Concept" is to do everything through Nitro. In that case there would be no problem.... I guess... Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Fri Apr 15 00:59:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 15 Apr 2005 07:59:48 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: If you are designing your application just drop the database and let og create the tables again. If you your application is live (in production) you have to manually alter the table. An older version of Og had an alter method that tried to automatically alter the table to much the updated class definition. I 'll reimplement this funtionality (or perhaps someone can send me a patch). regards, George. On 4/15/05, Ilias Lazaridis wrote: > I create a class, instantiate an object and save it within an sqlite3. > > I retrieve this object. > > [the table was created, and I load the object back] > > - > > In the next step, I add a new "property" to the class. > > I instantiate an new object, and try to save it. > > but: the save fails with an "field not fould" exception. > > [the new property i've added] > > - > > How do I setup OG that it automaticaly match the table to the updated > class-definition? (= automaticly add columns). > > . > > -- > http://lazaridis.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Fri Apr 15 01:44:29 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Fri, 15 Apr 2005 08:44:29 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: George Moschovitis wrote: > If you are designing your application just drop the database and let > og create the tables again. this is inconvenient. > If you your application is live (in > production) you have to manually alter the table. inconvenient, too. > An older version of Og had an alter method that tried to automatically > alter the table to much the updated class definition. I 'll > reimplement this funtionality (or perhaps someone can send me a > patch). this functionality is essential. I mean, why do I use a dynamic language? I hope this can be re-implemented soon, at least for simple modifications, like "add property", "remove property" or "change property type/size" etc. And: objects should have a flag, which disallows automated table-alterations. > regards, > George. > > On 4/15/05, Ilias Lazaridis wrote: > >>I create a class, instantiate an object and save it within an sqlite3. >> >>I retrieve this object. >> >>[the table was created, and I load the object back] >> >>- >> >>In the next step, I add a new "property" to the class. >> >>I instantiate an new object, and try to save it. >> >>but: the save fails with an "field not fould" exception. >> >>[the new property i've added] >> >>- >> >>How do I setup OG that it automaticaly match the table to the updated >>class-definition? (= automaticly add columns). >> >>. >> >>-- >>http://lazaridis.com >> >>_______________________________________________ >>Nitro-general mailing list >>Nitro-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/nitro-general >> > > > -- http://lazaridis.com From george.moschovitis at gmail.com Fri Apr 15 02:32:05 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 15 Apr 2005 09:32:05 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: > > If you are designing your application just drop the database and let > > og create the tables again. > this is inconvenient. not at all... takes 5 seconds. > > If you your application is live (in > > production) you have to manually alter the table. > inconvenient, too. well I agree, (but it takes about a min) > > An older version of Og had an alter method that tried to automatically > > alter the table to much the updated class definition. I 'll > > reimplement this funtionality (or perhaps someone can send me a > > patch). > this functionality is essential. I agree... > I hope this can be re-implemented soon, at least for simple > modifications, like "add property", "remove property" or "change > property type/size" etc. Will do :) thanks for the tips. -g. -- http://nitro.rubyforge.org http://www.joy.gr From epiperak at softlab.ece.ntua.gr Fri Apr 15 06:22:24 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 15 Apr 2005 13:22:24 +0300 (EEST) Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: Message-ID: My question is, it seems that "many" are demanding things from G. instead of offering usefull advice. Are we all donating for Nitro? and we have the luxury of demanding features? Or should we realize that Nitro is for free, and our comments are just "comments", aiming to in to improve Nitro...!? Just a suggestion... Right? > > > If you are designing your application just drop the database and let > > > og create the tables again. > > this is inconvenient. > > not at all... takes 5 seconds. > > > > If you your application is live (in > > > production) you have to manually alter the table. > > inconvenient, too. > > well I agree, (but it takes about a min) > > > > An older version of Og had an alter method that tried to automatically > > > alter the table to much the updated class definition. I 'll > > > reimplement this funtionality (or perhaps someone can send me a > > > patch). > > this functionality is essential. > > I agree... > > > I hope this can be re-implemented soon, at least for simple > > modifications, like "add property", "remove property" or "change > > property type/size" etc. > > Will do :) > > thanks for the tips. > > -g. > > -- > http://nitro.rubyforge.org > http://www.joy.gr > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From ilias at lazaridis.com Fri Apr 15 20:46:00 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 16 Apr 2005 03:46:00 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: Emmanuel Piperakis wrote: > My question is, it seems that "many" are demanding things from G. > instead of offering usefull advice. [you should write below the content] > Are we all donating for Nitro? Personally, I am donating time for a beta-state product. > and we have the luxury of demanding features? of course. If you are able to stop this ridiculous "demanding" tenor (which sadly is common within open source project). It is better to have 'demanding' users (whatever 'demanding' means) than silent users. > Or should we realize that Nitro is for free, and our comments are > just "comments", aiming to in to improve Nitro...!? Nitro is not for free. one has (like with any open-source software) to invest time and effort. > Just a suggestion... Right? you should possibly update the terribly outdated navel.gr website, instead of posting "just suggestions". >>>> If you are designing your application just drop the database >>>> and let og create the tables again. >>> >>> this is inconvenient. >> >> not at all... takes 5 seconds. >> >> >>>> If you your application is live (in production) you have to >>>> manually alter the table. >>> >>> inconvenient, too. >> >> well I agree, (but it takes about a min) >> >> >>>> An older version of Og had an alter method that tried to >>>> automatically alter the table to much the updated class >>>> definition. I 'll reimplement this funtionality (or perhaps >>>> someone can send me a patch). >>> >>> this functionality is essential. >> >> I agree... >> >> >>> I hope this can be re-implemented soon, at least for simple >>> modifications, like "add property", "remove property" or "change >>> property type/size" etc. >> >> Will do :) >> >> thanks for the tips. >> >> -g. >> >> -- http://nitro.rubyforge.org http://www.joy.gr >> >> _______________________________________________ Nitro-general >> mailing list Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to > Create is Devine, To teach is Primal, to Rule is Sin} -- http://lazaridis.com From epiperak at softlab.ece.ntua.gr Fri Apr 15 23:38:25 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Sat, 16 Apr 2005 06:38:25 +0300 (EEST) Subject: [Nitro] ... Message-ID: Well, it is matter of perspective. I can write on top or under... I gues it is up to me. >>> [you should write below the content] Time is irrelevant. Only life is... >Personally, I am donating time for a beta-state product. No. And if I undestand what you are saying correctly your goal it to stop the ridiculous demanding tenor of what? >of course. >If you are able to stop this ridiculous "demanding" tenor (which sadly is >common within open source project). Actually is is better to have innovative and creative users, than judgemental, critisizing ones.. >It is better to have 'demanding' users (whatever 'demanding' means) than >silent users. I am not responsible for navel.gr, and I spend my time creating and publishing instead of rewriting my cv and updating my web page. Well, some of us have actually the responsibility to create, while other just to evaluate. This reminds me of Mozart and Salieri, with the only differnce that at least Salieri was able to understand the talent of Mozart, where in your case you can not even grasp to understand the innovations in Nitro. In order to "evaluate" you must first create! Think about that. Anyway, I have a feeling that you draw some kind of perverted pleasure from these emails, so I will let you to it... Keep up the good comments, and the great evaluation, and thank you for your precious time. > you should possibly update the terribly outdated navel.gr website, > instead of posting "just suggestions". Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From paulha at aracnet.com Sat Apr 16 12:50:21 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Sat, 16 Apr 2005 09:50:21 -0700 Subject: [Nitro] ... In-Reply-To: References: Message-ID: <4261424D.4090402@aracnet.com> Sometimes the best strategy is to ignore "unhelpful" postings. Creates no ire, and teaches what the group is interested in... :O) Paul Emmanuel Piperakis wrote: >Well, it is matter of perspective. I can write on top or under... I gues >it is up to me. > > >>>>[you should write below the content] >>>> >>>> > >Time is irrelevant. Only life is... > > >>Personally, I am donating time for a beta-state product. >> >> > >No. And if I undestand what you are saying correctly your goal it to stop >the ridiculous demanding tenor of what? > > >>of course. >>If you are able to stop this ridiculous "demanding" tenor (which sadly is >>common within open source project). >> >> > >Actually is is better to have innovative and creative users, than >judgemental, critisizing ones.. > > >>It is better to have 'demanding' users (whatever 'demanding' means) than >>silent users. >> >> > >I am not responsible for navel.gr, and I spend my time creating and >publishing instead of rewriting my cv and updating my web page. Well, some >of us have actually the responsibility to create, while other just to >evaluate. This reminds me of Mozart and Salieri, with the only differnce >that at least Salieri was able to understand the talent of Mozart, where >in your case you can not even grasp to understand the innovations in >Nitro. In order to "evaluate" you must first create! Think about that. > >Anyway, I have a feeling that you draw some kind of perverted pleasure >from these emails, so I will let you to it... Keep up the good comments, >and the great evaluation, and thank you for your precious time. > > >>you should possibly update the terribly outdated navel.gr website, >>instead of posting "just suggestions". >> >> > > >Emmanouil Piperakis (epiperak at cs.ntua.gr) >{To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > >_______________________________________________ >Nitro-general mailing list >Nitro-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/nitro-general > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050416/f1af768d/attachment.html From ilias at lazaridis.com Sat Apr 16 14:24:12 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 16 Apr 2005 21:24:12 +0300 Subject: [Nitro] ... In-Reply-To: References: Message-ID: Emmanuel Piperakis wrote: [...] sorry for not answering to your message. I've just overflown it - and it looks not very relevant to my current task. . -- http://lazaridis.com From ilias at lazaridis.com Sat Apr 16 14:28:48 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 16 Apr 2005 21:28:48 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: George Moschovitis wrote: >>>If you are designing your application just drop the database and let >>>og create the tables again. >> >>this is inconvenient. > > not at all... takes 5 seconds. . >>>If you your application is live (in >>>production) you have to manually alter the table. >> >>inconvenient, too. > > well I agree, (but it takes about a min) . >>>An older version of Og had an alter method that tried to automatically >>>alter the table to much the updated class definition. I 'll >>>reimplement this funtionality (or perhaps someone can send me a >>>patch). >> >>this functionality is essential. > > I agree... ok, very nice. >>I hope this can be re-implemented soon, at least for simple >>modifications, like "add property", "remove property" or "change >>property type/size" etc. > > Will do :) ok, very nice. can you please tell me when you expect to have this included? [I'm not yet ready to write code in ruby - otherwise I would contribute this or assist you] > thanks for the tips. you're welcome. please let me know if you need further information, e.g. implementation suggestions. . -- http://lazaridis.com From dan at zeraweb.com Sun Apr 17 09:21:07 2005 From: dan at zeraweb.com (Dan Yoder) Date: Sun, 17 Apr 2005 08:21:07 -0500 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: <16f1af4591452ce3edaefa143ebc7be0@zeraweb.com> All - 1. I think it needs be somewhat of a given that criticisms or questions or whatever have a built in disclaimer that, hey, it is great that this framework is being developed, and i would offer this as a patch or something if could, but I lack the time/understanding/etc. to do so ... G. has, I think, been very much in this spirit in handling all our "demands." 2. As to the feature request for add/remove property, I think the entire schema migration issue is crucial. Already, Og differentiates itself from any alternative Ruby persistence frameworks in the fact that it is driven from the Ruby model and will automatically create the required tables. Adding automatic schema migration (and appropriate exceptions in the cases where this results in loss of data or is ambiguous) would cement Og's position as the emerging premier persistence solution in Ruby. 3. That said, I've tried to build such a thing (not in Ruby, but ...) and it isn't easy to get right. (How do you handle a field name change, for example?) This is why some folks find the database-driven (instead of Ruby driven) approach so appealing. You make the change in the database and you're done. Of course, this only actually works for simple examples or if you start using views, etc. It is worth considering whether the work involved in defining a view is any different than simply manually adding or removing fields. 4. In other words, this is a really cool feature request, but I am not so sure it is a very high priority. Just my two cents. p.s. I do think at some point (probably soon, based on the downloads) it will become important for Nitro to upgrade its image (Web sites, etc.). I would imagine that's in G's master plan. Awhile back, he talked to this issue in a post, and if I recall correctly, there were a few releases coming with crucial features, at which point some effort was going to be put into documentation, etc. --- Dan Yoder cell: 512-699-9866 email: dan at zeraweb.com On Apr 16, 2005, at 1:28 PM, Ilias Lazaridis wrote: > George Moschovitis wrote: >>>> If you are designing your application just drop the database and let >>>> og create the tables again. >>> >>> this is inconvenient. >> not at all... takes 5 seconds. > > . > >>>> If you your application is live (in >>>> production) you have to manually alter the table. >>> >>> inconvenient, too. >> well I agree, (but it takes about a min) > > . > >>>> An older version of Og had an alter method that tried to >>>> automatically >>>> alter the table to much the updated class definition. I 'll >>>> reimplement this funtionality (or perhaps someone can send me a >>>> patch). >>> >>> this functionality is essential. >> I agree... > > ok, very nice. > >>> I hope this can be re-implemented soon, at least for simple >>> modifications, like "add property", "remove property" or "change >>> property type/size" etc. >> Will do :) > > ok, very nice. > > can you please tell me when you expect to have this included? > > [I'm not yet ready to write code in ruby - otherwise I would > contribute this or assist you] > >> thanks for the tips. > > you're welcome. > > please let me know if you need further information, e.g. > implementation suggestions. > > . > > -- > http://lazaridis.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From george.moschovitis at gmail.com Sun Apr 17 09:37:08 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 17 Apr 2005 16:37:08 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: <16f1af4591452ce3edaefa143ebc7be0@zeraweb.com> References: <16f1af4591452ce3edaefa143ebc7be0@zeraweb.com> Message-ID: > 2. As to the feature request for add/remove property, I think the > entire schema migration issue is crucial. Already, Og differentiates > ... > ambiguous) would cement Og's position as the emerging premier > persistence solution in Ruby. don't worry, It will be done. > few releases coming with crucial features, at which point some effort > was going to be put into documentation, etc. I plan to start working on more documentation in May. I want to work over the last two weeks of April on some critical features and nail down the API's first. -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Mon Apr 18 03:58:45 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 18 Apr 2005 10:58:45 +0300 Subject: [Nitro] [ANN] Nitro + Og 0.16.0, AOP, TDD, Plain CGI, Code refactoring and more Message-ID: Hello everyone, A new version of Nitro was just released. You can downloaded the new version here: http://rubyforge.org/frs/?group_id=418&release_id=2023 have fun, George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Mon Apr 18 07:09:28 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 18 Apr 2005 14:09:28 +0300 Subject: [Nitro] Using facets with Nitro Message-ID: Hello all, In order to avoid reimplementing the wheel I am thinking about using Facets to provide common functionality to Nitro applications. This means I 'll remove some utilities from Glue in order to use the equivalent methods provided in Facets, and if possible donate some utilities to the Facets project. Any opinions on this? regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Mon Apr 18 09:07:20 2005 From: james_b at neurogami.com (James Britt) Date: Mon, 18 Apr 2005 06:07:20 -0700 Subject: [Nitro] Using facets with Nitro In-Reply-To: References: Message-ID: <4263B108.6000307@neurogami.com> George Moschovitis wrote: > Hello all, > > In order to avoid reimplementing the wheel I am thinking about using > Facets to provide common functionality to Nitro applications. This > means I 'll remove some utilities from Glue in order to use the > equivalent methods provided in Facets, and if possible donate some > utilities to the Facets project. > > Any opinions on this? I like the idea. James From kostas at nasis.com Mon Apr 18 09:16:38 2005 From: kostas at nasis.com (Kostas Nasis) Date: Mon, 18 Apr 2005 09:16:38 -0400 Subject: [Nitro] Using facets with Nitro In-Reply-To: References: Message-ID: <4263B336.1050908@nasis.com> I haven't looked at Facets, but I think this makes sense. How do they currently overlap? That is, what's in Glue that's also in Facets, and what's in Glue that isn't in Facets? Kostas George Moschovitis wrote: >Hello all, > >In order to avoid reimplementing the wheel I am thinking about using >Facets to provide common functionality to Nitro applications. This >means I 'll remove some utilities from Glue in order to use the >equivalent methods provided in Facets, and if possible donate some >utilities to the Facets project. > >Any opinions on this? > >regards, >George. > > > From ilias at lazaridis.com Mon Apr 18 20:32:33 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Tue, 19 Apr 2005 03:32:33 +0300 Subject: [Nitro] Using facets with Nitro In-Reply-To: References: Message-ID: George Moschovitis wrote: > Hello all, > > In order to avoid reimplementing the wheel I am thinking about using > Facets to provide common functionality to Nitro applications. This > means I 'll remove some utilities from Glue in order to use the > equivalent methods provided in Facets, and if possible donate some > utilities to the Facets project. > > Any opinions on this? reuse is positive. what is the license of product "facets"? [please provide a pointer] > regards, > George. . -- http://lazaridis.com From alang at cronosys.com Tue Apr 19 09:49:42 2005 From: alang at cronosys.com (Alan Garrison) Date: Tue, 19 Apr 2005 09:49:42 -0400 Subject: [Nitro] Using facets with Nitro In-Reply-To: References: Message-ID: <42650C76.7050703@cronosys.com> Ilias Lazaridis wrote: > > what is the license of product "facets"? > > [please provide a pointer] > http://calibre.rubyforge.org/facets/doc/index.html -- Alan Garrison Cronosys, LLC Phone: 216-221-4600 ext 308 From ilias at lazaridis.com Tue Apr 19 20:46:28 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Wed, 20 Apr 2005 03:46:28 +0300 Subject: [Nitro] Using facets with Nitro In-Reply-To: <42650C76.7050703@cronosys.com> References: <42650C76.7050703@cronosys.com> Message-ID: Alan Garrison wrote: > Ilias Lazaridis wrote: > >> >> what is the license of product "facets"? >> >> [please provide a pointer] >> > > http://calibre.rubyforge.org/facets/doc/index.html thank's a lot. It looks to me, that commercial development would be allowed with ruby/nitro/facets: http://calibre.rubyforge.org/facets/doc/files/LICENSE-RUBY.html This must be clarified, to ensure the success of Nitro. . -- http://lazaridis.com From george.moschovitis at gmail.com Thu Apr 21 03:24:56 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 21 Apr 2005 10:24:56 +0300 Subject: [Nitro] Javascript library Message-ID: Hello all, I am planning to integrate a javascript library in the next version of Nitro. The obvious candidate is Prototype but I was wondering if there is a better suggestion. Any ideas? regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Thu Apr 21 03:28:30 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 21 Apr 2005 10:28:30 +0300 Subject: [Nitro] Og update Message-ID: Hello all, I am planning an extensive update of the Og library. The api changes will be minimal, but the new implementation will allow for some *important* and some 'cool' new features. Now is the time to send me your suggestions about things that are not great in the current version, or ideas for new features. I plan to work on this over the weekend. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From daniel at bovensiepen.net Thu Apr 21 15:52:00 2005 From: daniel at bovensiepen.net (Daniel Bovensiepen) Date: Thu, 21 Apr 2005 21:52:00 +0200 Subject: [Nitro] Og update In-Reply-To: Message-ID: I'm not sure if this possible but it would be wonderfull if the og library 'ALTER' the given table structure. So I don't need to delete the tables if I changed the property. So far I can say: 'og is good enough' mfg daniel Am 21.04.2005 9:28 Uhr schrieb "George Moschovitis" unter : > Hello all, > > I am planning an extensive update of the Og library. The api changes > will be minimal, but the new implementation will allow for some > *important* and some 'cool' new features. > Now is the time to send me your suggestions about things that are not > great in the current version, or ideas for new features. I plan to > work on this over the weekend. > > regards, > George. From james_b at neurogami.com Thu Apr 21 16:09:03 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 21 Apr 2005 13:09:03 -0700 Subject: [Nitro] Javascript library In-Reply-To: References: Message-ID: <4268085F.4070403@neurogami.com> George Moschovitis wrote: > Hello all, > > I am planning to integrate a javascript library in the next version of > Nitro. The obvious candidate is Prototype but I was wondering if there > is a better suggestion. Any ideas? What do you mean by "integrate" ? Can it be done such that libraries are swappable? James From george.moschovitis at gmail.com Thu Apr 21 16:10:45 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 21 Apr 2005 23:10:45 +0300 Subject: [Nitro] Og update In-Reply-To: References: Message-ID: > So far I can say: 'og is good enough' Wait 'till you see the new version :) :) :) :) You will be pleasantly surprised. -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Thu Apr 21 16:13:03 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 21 Apr 2005 23:13:03 +0300 Subject: [Nitro] Javascript library In-Reply-To: <4268085F.4070403@neurogami.com> References: <4268085F.4070403@neurogami.com> Message-ID: I mean provide the library by default. A javascript library should allow for effects like div toggling, ajax, drag&drop and stuff like that. Of course a developer could replace that library with another, but I am planning to add some ruby helpers to better integrate this with nitro. -g. On 4/21/05, James Britt wrote: > George Moschovitis wrote: > > Hello all, > > > > I am planning to integrate a javascript library in the next version of > > Nitro. The obvious candidate is Prototype but I was wondering if there > > is a better suggestion. Any ideas? > > What do you mean by "integrate" ? > > Can it be done such that libraries are swappable? > > James > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Thu Apr 21 16:58:06 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 21 Apr 2005 13:58:06 -0700 Subject: [Nitro] Og update In-Reply-To: References: Message-ID: <426813DE.90907@neurogami.com> George Moschovitis wrote: > Hello all, > > I am planning an extensive update of the Og library. The api changes > will be minimal, but the new implementation will allow for some > *important* and some 'cool' new features. > Now is the time to send me your suggestions about things that are not > great in the current version, or ideas for new features. I plan to > work on this over the weekend. I've not spent enough time with Og to say too much, but recent discussions on object persistence and revival had me wondering if the dominant model for the data was objects or relational database. This question was particularly prominent when trying to use the file system adapter. There didn't seem to be any support for raw SQL, and I wondered if that wasn't the wrong direction anyway. Better perhaps if there was a Ruby-style API for finding, updating, etc. That a database was used as the back end would be hidden. James From craig-duncan at earthlink.net Thu Apr 21 22:07:36 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Thu, 21 Apr 2005 22:07:36 -0400 Subject: [Nitro] Og update In-Reply-To: <426813DE.90907@neurogami.com> References: <426813DE.90907@neurogami.com> Message-ID: <42685C68.6010003@earthlink.net> James Britt wrote: > George Moschovitis wrote: > >> Hello all, >> >> I am planning an extensive update of the Og library. The api changes >> will be minimal, but the new implementation will allow for some >> *important* and some 'cool' new features. >> Now is the time to send me your suggestions about things that are not >> great in the current version, or ideas for new features. I plan to >> work on this over the weekend. > > > > I've not spent enough time with Og to say too much, but recent > discussions on object persistence and revival had me wondering if the > dominant model for the data was objects or relational database. > > This question was particularly prominent when trying to use the file > system adapter. There didn't seem to be any support for raw SQL, and I > wondered if that wasn't the wrong direction anyway. Better perhaps if > there was a Ruby-style API for finding, updating, etc. That a database > was used as the back end would be hidden. I've spent a fairly small amount of time so far trying to use ActiveRecord, and none at all yet with OG. I decided that, conceptually, i preferred the AR approach of generating methods from an existing database schema. After working with it a little, though, i have to say that i really don't like AR. Creating various associations (has_one, belongs_to, etc) seems much more cumbersome to me than what i would hope to be able to do by simply writing a sql query wrapped inside a method where i can assign the values returned from the query to ruby variables. This seems like it should be simpler to code, easier to work with, and more flexible. There may actually be a way to do this with AR but questions to the mailing list haven't resulted in anything very helpful to me at the stage i'm at and the documentation is dreadful. I wonder if OG could provide the kind of interface i'm alluding to? craig From paulha at aracnet.com Thu Apr 21 22:35:49 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Thu, 21 Apr 2005 19:35:49 -0700 Subject: [Nitro] Inheritance with Og? In-Reply-To: <42685C68.6010003@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> Message-ID: <42686305.1000505@aracnet.com> If I derive a new class from an Og class, and I add a field to the derived class, how is this handled? Is a new table created, or a field added to the old? I suppose according to the rules of *relational* databases this shouldn't happen. Does Og handle it? (I'm not suggesting that it should...) If I should be able to get this from the docs, just point me in the right direction! ;-) craig duncan wrote: > James Britt wrote: > >> George Moschovitis wrote: >> >>> Hello all, >>> >>> I am planning an extensive update of the Og library. The api changes >>> will be minimal, but the new implementation will allow for some >>> *important* and some 'cool' new features. >>> Now is the time to send me your suggestions about things that are not >>> great in the current version, or ideas for new features. I plan to >>> work on this over the weekend. >> >> >> >> >> I've not spent enough time with Og to say too much, but recent >> discussions on object persistence and revival had me wondering if the >> dominant model for the data was objects or relational database. >> >> This question was particularly prominent when trying to use the file >> system adapter. There didn't seem to be any support for raw SQL, and >> I wondered if that wasn't the wrong direction anyway. Better perhaps >> if there was a Ruby-style API for finding, updating, etc. That a >> database was used as the back end would be hidden. > > > I've spent a fairly small amount of time so far trying to use > ActiveRecord, and none at all yet with OG. I decided that, > conceptually, i preferred the AR approach of generating methods from > an existing database schema. After working with it a little, though, > i have to say that i really don't like AR. Creating various > associations (has_one, belongs_to, etc) seems much more cumbersome to > me than what i would hope to be able to do by simply writing a sql > query wrapped inside a method where i can assign the values returned > from the query to ruby variables. This seems like it should be > simpler to code, easier to work with, and more flexible. There may > actually be a way to do this with AR but questions to the mailing list > haven't resulted in anything very helpful to me at the stage i'm at > and the documentation is dreadful. I wonder if OG could provide the > kind of interface i'm alluding to? > > craig > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050421/477d8865/attachment.html From james_b at neurogami.com Thu Apr 21 23:15:09 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 21 Apr 2005 20:15:09 -0700 Subject: [Nitro] Og update In-Reply-To: <42685C68.6010003@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> Message-ID: <42686C3D.7080201@neurogami.com> craig duncan wrote: > > I've spent a fairly small amount of time so far trying to use > ActiveRecord, and none at all yet with OG. I decided that, > conceptually, i preferred the AR approach of generating methods from an > existing database schema. After working with it a little, though, i > have to say that i really don't like AR. Creating various associations > (has_one, belongs_to, etc) seems much more cumbersome to me than what i > would hope to be able to do by simply writing a sql query wrapped inside > a method where i can assign the values returned from the query to ruby > variables. This seems like it should be simpler to code, easier to work > with, and more flexible. There may actually be a way to do this with AR > but questions to the mailing list haven't resulted in anything very > helpful to me at the stage i'm at and the documentation is dreadful. I > wonder if OG could provide the kind of interface i'm alluding to? Ironic that you might get a better Rails answer on the Nitro list, but here goes: Rails has find_by_sql: sql = "select t.* from tags t where t.tag in ( #{tag_set_str} ) " tags = Tag.find_by_sql( sql ) # Now tags has a set of Tag objects. I have a Rails app that is probably 90% SQL, as the API associations where simply too weak to get me what I wanted. That may have changed in the current version, but given some of the quirky SQL I've had to write (due, in large part, to short comings with MySQL), I have a hard time believing that the dynamic SQL generation is anything near optimized. This may be a good example a reason one might choose Rails over Nitro, or vice versa, or simply roll their own code. One of my apps started using Rails, but I hacked around quite a bit; it is now mainly Catapult + AR + lots of SQL and object munging. Ruby makes this easy, and in retrospect I don't see that using Rails gained me much (other than an education in Rails). With about the same amount of effort I could have simply done the O/R mapping myself and just writing a fairly straightforward database-backed Web service. And have fewer files laying around. It's also the sort of thing where I don't think Nitro would be a good fit, because I already know and have the data, I need to hand code the SQL, and I'm just rendering result sets in assorted markup based on various queries. There are very few objects, and there is very little business logic; it's mostly "Look this up and wrap RDF around the results." For other applications, the objects are the main thing, with the data being something of residual artifacts. In those cases, I don't really want to think in SQL, I want to think in object relationships. I think Kirbybase is an example of this. I can see, though, were one might need to go to the metal, as it were, and run specific SQL against the database to get the correct object set (and ensure it happens efficiently). I think, though, that this makes it harder to write cross-Og adapter code, as not all persistence layers use SQL (or use it the same way). But, being coupled to a particular persistence layer is often a design choice one has to make as the requirements become clearer. In my experience, database-hopping is rare, and trying to build this in is typically not worth the overhead. James From james_b at neurogami.com Thu Apr 21 23:16:57 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 21 Apr 2005 20:16:57 -0700 Subject: [Nitro] Inheritance with Og? In-Reply-To: <42686305.1000505@aracnet.com> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42686305.1000505@aracnet.com> Message-ID: <42686CA9.7090903@neurogami.com> PAUL HANCHETT wrote: > If I derive a new class from an Og class, and I add a field to the > derived class, how is this handled? Is a new table created, or a field > added to the old? > > I suppose according to the rules of *relational* databases this > shouldn't happen. Does Og handle it? (I'm not suggesting that it > should...) My sense of POLS is that there should be a new table created, one named after the new class, with fields mapped to the class properties. James From craig-duncan at earthlink.net Thu Apr 21 23:41:57 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Thu, 21 Apr 2005 23:41:57 -0400 Subject: OT: AR difficulties (was Re: [Nitro] Og update) In-Reply-To: <42686C3D.7080201@neurogami.com> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42686C3D.7080201@neurogami.com> Message-ID: <42687285.1000406@earthlink.net> James Britt wrote: > Ironic that you might get a better Rails answer on the Nitro list, but > here goes: > > Rails has find_by_sql: > > sql = "select t.* from tags t where t.tag in ( #{tag_set_str} ) " > tags = Tag.find_by_sql( sql ) > > # Now tags has a set of Tag objects. I knew about find_by_sql. I don't think that gives me what i'm looking for, though, as it returns (in this instance) Tag objects which map directly to the "tags" table. My desire is not to have my objects limited to having to map directly to a db table because my sql query will do joins that pull values from multiple tables. I just can't get my head around AR because there is zero documentation at the right level and because of all the magic (using const_missing and method_missing everywhere). I think maybe i'll just learn PHP. :-) This is seriously off-topic, but i think ruby magic takes the difficulty of understanding how an application works (absent good documentation) to a significantly higher level than what i'm used to with C/C++. > I have a Rails app that is probably 90% SQL, as the API associations were > simply too weak to get me what I wanted. ... and in retrospect I don't see > that using Rails gained me much (other than an education in Rails). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...the *one* thing that keeps me going with this... even though what i'm trying to do sounds very similar to what you described: > With about the same amount of effort I could have > simply done the O/R mapping myself and just writing a fairly > straightforward database-backed Web service. And have fewer files > laying around. ... > because I already know and have the data, I need to hand code the > SQL, and I'm just rendering result sets in assorted markup based on > various queries. There are very few objects, and there is very little > business logic; it's mostly "Look this up and wrap RDF around the results." craig From paulha at aracnet.com Fri Apr 22 01:44:21 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Thu, 21 Apr 2005 22:44:21 -0700 Subject: [Nitro] Inheritance with Og? In-Reply-To: <42686CA9.7090903@neurogami.com> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42686305.1000505@aracnet.com> <42686CA9.7090903@neurogami.com> Message-ID: <42688F35.9040205@aracnet.com> Ah! That would make sense. :-) James Britt wrote: > PAUL HANCHETT wrote: > >> If I derive a new class from an Og class, and I add a field to the >> derived class, how is this handled? Is a new table created, or a >> field added to the old? >> >> I suppose according to the rules of *relational* databases this >> shouldn't happen. Does Og handle it? (I'm not suggesting that it >> should...) > > > My sense of POLS is that there should be a new table created, one > named after the new class, with fields mapped to the class properties. > > James > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050422/906289c0/attachment.html From george.moschovitis at gmail.com Fri Apr 22 02:45:23 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 22 Apr 2005 09:45:23 +0300 Subject: [Nitro] Og update In-Reply-To: <42685C68.6010003@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> Message-ID: Can you explain more what you want? An advantage of Og over AR is that it automatically creates the correct schema for the associations (or Relations as they are called in Og). The same happens with Mixins. For example, Og automatically creates the table columns to support the nested_sets pattern, thus fully encapsulating the pattern. -g. On 4/22/05, craig duncan wrote: > James Britt wrote: > > George Moschovitis wrote: > > > >> Hello all, > >> > >> I am planning an extensive update of the Og library. The api changes > >> will be minimal, but the new implementation will allow for some > >> *important* and some 'cool' new features. > >> Now is the time to send me your suggestions about things that are not > >> great in the current version, or ideas for new features. I plan to > >> work on this over the weekend. > > > > > > > > I've not spent enough time with Og to say too much, but recent > > discussions on object persistence and revival had me wondering if the > > dominant model for the data was objects or relational database. > > > > This question was particularly prominent when trying to use the file > > system adapter. There didn't seem to be any support for raw SQL, and I > > wondered if that wasn't the wrong direction anyway. Better perhaps if > > there was a Ruby-style API for finding, updating, etc. That a database > > was used as the back end would be hidden. > > I've spent a fairly small amount of time so far trying to use ActiveRecord, and none > at all yet with OG. I decided that, conceptually, i preferred the AR approach of > generating methods from an existing database schema. After working with it a little, > though, i have to say that i really don't like AR. Creating various associations > (has_one, belongs_to, etc) seems much more cumbersome to me than what i would hope to > be able to do by simply writing a sql query wrapped inside a method where i can > assign the values returned from the query to ruby variables. This seems like it > should be simpler to code, easier to work with, and more flexible. There may > actually be a way to do this with AR but questions to the mailing list haven't > resulted in anything very helpful to me at the stage i'm at and the documentation is > dreadful. I wonder if OG could provide the kind of interface i'm alluding to? > > craig > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Fri Apr 22 05:45:25 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 22 Apr 2005 12:45:25 +0300 Subject: [Nitro] Inheritance with Og? In-Reply-To: <42688F35.9040205@aracnet.com> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42686305.1000505@aracnet.com> <42686CA9.7090903@neurogami.com> <42688F35.9040205@aracnet.com> Message-ID: I have something regarding inheritance in my mind :) -g. On 4/22/05, PAUL HANCHETT wrote: > Ah! That would make sense. :-) > > > James Britt wrote: > PAUL HANCHETT wrote: > > If I derive a new class from an Og class, and I add a field to the > derived class, how is this handled? Is a new table created, or a field > added to the old? > > I suppose according to the rules of *relational* databases this shouldn't > happen. Does Og handle it? (I'm not suggesting that it should...) > > My sense of POLS is that there should be a new table created, one named > after the new class, with fields mapped to the class properties. > > James > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > -- http://nitro.rubyforge.org http://www.joy.gr From craig-duncan at earthlink.net Fri Apr 22 10:39:01 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Fri, 22 Apr 2005 10:39:01 -0400 Subject: [Nitro] Og update In-Reply-To: References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> Message-ID: <42690C85.1090208@earthlink.net> George Moschovitis wrote: > Can you explain more what you want? An advantage of Og over AR is that > it automatically creates the correct schema for the associations (or > Relations as they are called in Og). The same happens with Mixins. For > example, Og automatically creates the table columns to support the > nested_sets pattern, thus fully encapsulating the pattern. > > -g. a) i want something that's documented (reasonably well) so that even if the way to use the feature is not entirely obvious or maybe even a little difficult, i can still manage it without tearing my hair out. Also, the difficulty (over what i could accomplish more simply) should be worth the effort. b) if i can't easily (enough) figure out how a certain (powerful) feature works and i know that what i want should be easily doable, then there should be some alternate, probably not as powerful, but easy to grasp, mechanism for accomplishing roughly the same thing. So, with ActiveRecord, what i've wanted to do is select (via multiple joins) fields from a number of tables... not one by one but in a single query that hits the database just once and returns a single result (this is exactly what i would do if i were working directly in sql). In principle this seems very simple to me, and i perfectly well understand how to write the sql. My (fuzzier) notion of how this data will be returned to me (since it doesn't map to any individual db table) was some mechanism that would allow me to create a class with members giving me access to each field returned from the query. Maybe i should use a view but i've been resisting that idea because i'm not clear how updates would work and AR, in this instance, would be providing me with nothing but the most limited capability and so... why bother? Further, i have just run into the situation where one of my ancillary tables is selected from via *two* key fields in my main table. So far, with AR, i know of no (non-kludgy) way of doing this, nor have i yet received any answer from the Rails mailing list. Overall, what i want to do is really *quite* simple. I have a very normalized set of tables. And yet it is proving (to me) amazingly difficult to even understand the approach i'm supposed to take with AR regarding these various issues (which is, admittedly, pretty much a documentation problem). As far as what you've said about automatically creating the Relations, i have no idea how this would work, so i can't say if it would provide the means to do what i'm trying to do. craig P.S. After looking at such a lot of really poor documentation (not from the standpoint of what's expected from an IBM reference manual, but from virtually any other) i've had the thought of volunteering to write documentation... if someone would be willing to *explain* to me how the thing to be documented works (iteratively, of course). It's a truism but anyone who knows how something works too well and/or learned it too long ago, is virtually incapable of doing good documentation, because they skip over too much that is so obvious to them that it exists beneath the level of conscious awareness. From james_b at neurogami.com Fri Apr 22 11:00:01 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 22 Apr 2005 08:00:01 -0700 Subject: [Nitro] Og update In-Reply-To: <42690C85.1090208@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> Message-ID: <42691171.7010802@neurogami.com> craig duncan wrote: > George Moschovitis wrote: > >> Can you explain more what you want? An advantage of Og over AR is that >> it automatically creates the correct schema for the associations (or >> Relations as they are called in Og). The same happens with Mixins. For >> example, Og automatically creates the table columns to support the >> nested_sets pattern, thus fully encapsulating the pattern. >> >> -g. > > > a) i want something that's documented (reasonably well) so that even if > the way to use the feature is not entirely obvious or maybe even a > little difficult, i can still manage it without tearing my hair out. > Also, the difficulty (over what i could accomplish more simply) should > be worth the effort. > > b) if i can't easily (enough) figure out how a certain (powerful) > feature works and i know that what i want should be easily doable, then > there should be some alternate, probably not as powerful, but easy to > grasp, mechanism for accomplishing roughly the same thing. > > So, with ActiveRecord, what i've wanted to do is select (via multiple > joins) fields from a number of tables... not one by one but in a single > query that hits the database just once and returns a single result (this > is exactly what i would do if i were working directly in sql). In > principle this seems very simple to me, and i perfectly well understand > how to write the sql. My (fuzzier) notion of how this data will be > returned to me (since it doesn't map to any individual db table) was > some mechanism that would allow me to create a class with members giving > me access to each field returned from the query. Maybe i should use a > view but i've been resisting that idea because i'm not clear how updates > would work and AR, in this instance, would be providing me with nothing > but the most limited capability and so... why bother? Craig, I tried to reply privately to an earlier message, but it bounced. I didn't want to turn this into Yet Another Rails List, but this may be of interest to George as a way of perhaps explaining some behavior. I haven't checked this lately, but I recall that when I used custom SQL to fetch an object set in Rails, the properties of each object were determined by the fields requested, not the class making the request. So, sql = "select t.id as tag_id from tags t " tag_ids = Tag.find_by_sql( sql ) would give a set of objects of class Tag, but each object would only have a single property, 'tag_id' (though I generally use it to add new properties to objects when the extra info is useful in the view). I believe that you can create arbitrary objects like this, though I'm unsure if there are restrictions or consequences based on what main class is used to run the query. But I also suspect that writing something that just returned smart Structs or something, based on the result set, would be simple. Given a result set, one would just need to loop over each row and dynamically create a new object with properties mapped to field names. e.g: obj_set = ObjectSet.get( "select t.name as name from tags t, p.url as url from posts p where p.id = t.post_id" ) # obj_set should now have objects with properties 'name' and 'url' There have been some recent threads on ruby-talk about dynamically adding attributes, or one could first dynamically construct a class def based on the field names in the result set, then create an instance of this for each row. > > Further, i have just run into the situation where one of my ancillary > tables is selected from via *two* key fields in my main table. So far, > with AR, i know of no (non-kludgy) way of doing this, nor have i yet > received any answer from the Rails mailing list. > > Overall, what i want to do is really *quite* simple. I have a very > normalized set of tables. And yet it is proving (to me) amazingly > difficult to even understand the approach i'm supposed to take with AR > regarding these various issues (which is, admittedly, pretty much a > documentation problem). Rails can be overkill. AR may be overkill. Creating objects from a result set is trivial. > > As far as what you've said about automatically creating the Relations, i > have no idea how this would work, so i can't say if it would provide the > means to do what i'm trying to do. > > craig > > P.S. After looking at such a lot of really poor documentation (not from > the standpoint of what's expected from an IBM reference manual, but from > virtually any other) i've had the thought of volunteering to write > documentation... if someone would be willing to *explain* to me how the > thing to be documented works (iteratively, of course). It's a truism > but anyone who knows how something works too well and/or learned it too > long ago, is virtually incapable of doing good documentation, because > they skip over too much that is so obvious to them that it exists > beneath the level of conscious awareness. I started writing my Nitro tutorial as a way to help me learn how to use it. I basically tried to start off with the simplest case, see how to do something, then gradually add features based on likely use cases. I know from experience that documenting one's own work can be hard precisely because you lose track of what is intuitive and what isn't, which I think may be an argument for using obvious method names, and maybe following comment-driven development James From ilias at lazaridis.com Fri Apr 22 11:20:57 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Fri, 22 Apr 2005 18:20:57 +0300 Subject: [Nitro] Og update In-Reply-To: <42690C85.1090208@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> Message-ID: craig duncan wrote: > George Moschovitis wrote: > >> Can you explain more what you want? An advantage of Og over AR is that >> it automatically creates the correct schema for the associations (or >> Relations as they are called in Og). The same happens with Mixins. For >> example, Og automatically creates the table columns to support the >> nested_sets pattern, thus fully encapsulating the pattern. >> >> -g. > > > a) i want something that's documented (reasonably well) so that even if [...] > It's a truism > but anyone who knows how something works too well and/or learned it too > long ago, is virtually incapable of doing good documentation, because > they skip over too much that is so obvious to them that it exists > beneath the level of conscious awareness. I like to remember Mr. Moschovitis what I've told him a few weeks before subjecting documentation. "your documentation cannot be good. Please assist me to make the jamPersist evaluation, which can serve as an intro tutorial.". - I will make a document similar to this: http://lazaridis.com/case/persist/schevo.html when the "auto-restructure" option is available within OG. The evaluation will work with a hassle-free bundled SQLite3 database - download and run. . -- http://lazaridis.com From craig-duncan at earthlink.net Fri Apr 22 16:42:39 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Fri, 22 Apr 2005 16:42:39 -0400 Subject: [Nitro] Og update In-Reply-To: <42691171.7010802@neurogami.com> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> <42691171.7010802@neurogami.com> Message-ID: <426961BF.8030609@earthlink.net> James Britt wrote: > I didn't want to turn this into Yet Another Rails List, but this may be > of interest to George as a way of perhaps explaining some behavior. > obj_set = ObjectSet.get( "select t.name as name from tags t, > p.url as url from posts p > where p.id = t.post_id" ) > > # obj_set should now have objects with properties 'name' and 'url' Very cool! How can so many people be working on Rails and have been able to live without having (more or less) worked out this problem? Oh... i forget... Rails hasn't hit 1.0 yet. :-) Anyways, thanks James, you have given me my direction for how to (try to) make this work without having to change my db schema or resort to other kludginess. > There have been some recent threads on ruby-talk about dynamically > adding attributes, or one could first dynamically construct a class def > based on the field names in the result set, then create an instance of > this for each row. I haven't been keeping up on ruby-talk. But i thought this was already "easy" to do. ? i.e. no real innovation required (just exercising Ruby's existing metaprogramming abilities). > Rails can be overkill. AR may be overkill. Something to ponder and, although i don't yet know enough, those conclusions have certainly crossed my mind. Or both overkill and underkill at the same time. :-) > I started writing my Nitro tutorial as a way to help me learn how to use > it. I basically tried to start off with the simplest case, see how to > do something, then gradually add features based on likely use cases. Well, in all seriousness, i started with Rails and haven't really touched Nitro yet. But if you want some eyes on what you've produced so far, i'd love to take a look. I could probably give you some good feedback. craig From james_b at neurogami.com Fri Apr 22 18:15:27 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 22 Apr 2005 15:15:27 -0700 Subject: [Nitro] Og update In-Reply-To: <426961BF.8030609@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> <42691171.7010802@neurogami.com> <426961BF.8030609@earthlink.net> Message-ID: <4269777F.9010600@neurogami.com> craig duncan wrote: > James Britt wrote: > >> I didn't want to turn this into Yet Another Rails List, but this may >> be of interest to George as a way of perhaps explaining some behavior. > > > > >> obj_set = ObjectSet.get( "select t.name as name from tags t, >> p.url as url from posts p >> where p.id = t.post_id" ) >> >> # obj_set should now have objects with properties 'name' and 'url' > > > Very cool! How can so many people be working on Rails and have been > able to live without having (more or less) worked out this problem? > Oh... i forget... Rails hasn't hit 1.0 yet. :-) Well, I believe this sort of thing *can* be done inside Rails (though not quite the way I would prefer); my experience with the Rails mailing list is that most people there know very little Ruby, and build apps only by following Rails tutorials or examples. I don't think many people actually look at the source code. > > Anyways, thanks James, you have given me my direction for how to (try > to) make this > work without having to change my db schema or resort to other kludginess. > >> There have been some recent threads on ruby-talk about dynamically >> adding attributes, or one could first dynamically construct a class >> def based on the field names in the result set, then create an >> instance of this for each row. > > > I haven't been keeping up on ruby-talk. But i thought this was already > "easy" to do. ? i.e. no real innovation required (just exercising > Ruby's existing metaprogramming abilities). It is easy to do. But maybe not obvious. (I keep toying with the idea of writing a Ruby tutorial, one that would focus on the Lispy metaprgramming aspects that are either ignored or buried in other Ruby books and how-tos.) > >> Rails can be overkill. AR may be overkill. > > > Something to ponder and, although i don't yet know enough, those > conclusions have certainly crossed my mind. Or both overkill and > underkill at the same time. :-) Well, I like Rails for certain types of applications, but the Nitro approach seems a better fit for much of what I do. Rails, though, seems to be approaching a shotgun/kitchen-sink framework, what with the increasing number of built-in libraries and code generators. One is strongly encouraged to do things the Rails way, not the Ruby way, which may lead to brittle or highly-coupled code. Doing the simple thing can get hard, then, unless you know the specific Rails API call. > >> I started writing my Nitro tutorial as a way to help me learn how to >> use it. I basically tried to start off with the simplest case, see >> how to do something, then gradually add features based on likely use >> cases. > > > Well, in all seriousness, i started with Rails and haven't really > touched Nitro yet. But if you want some eyes on what you've produced so > far, i'd love to take a look. I could probably give you some good > feedback. Thanks. I have to review and revise what I have already written, seeing how Nitro keeps changing (Damn you, George!). I'll send you a copy when the revisions are done. James From george.moschovitis at gmail.com Sat Apr 23 00:57:50 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 23 Apr 2005 07:57:50 +0300 Subject: [Nitro] Og update In-Reply-To: <42690C85.1090208@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> Message-ID: > P.S. After looking at such a lot of really poor documentation (not from the > standpoint of what's expected from an IBM reference manual, but from virtually any > other) i've had the thought of volunteering to write documentation... if someone > would be willing to *explain* to me how the thing to be documented works > (iteratively, of course). It's a truism but anyone who knows how something works too > well and/or learned it too long ago, is virtually incapable of doing good > documentation, because they skip over too much that is so obvious to them that it > exists beneath the level of conscious awareness. Should I consider this as an offer to write some documentation? :-) In any case I will help you with any questions you have. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Sat Apr 23 01:00:15 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 23 Apr 2005 08:00:15 +0300 Subject: [Nitro] Og update In-Reply-To: <4269777F.9010600@neurogami.com> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> <42691171.7010802@neurogami.com> <426961BF.8030609@earthlink.net> <4269777F.9010600@neurogami.com> Message-ID: > Thanks. I have to review and revise what I have already written, seeing > how Nitro keeps changing (Damn you, George!). I'll send you a copy when > the revisions are done. Sorry for that James ;-) But at least Og will be pretty stabilized from the next version on. -g. -- http://nitro.rubyforge.org http://www.joy.gr From james_b at neurogami.com Sat Apr 23 01:17:38 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 22 Apr 2005 22:17:38 -0700 Subject: [Nitro] Og update In-Reply-To: References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> <42691171.7010802@neurogami.com> <426961BF.8030609@earthlink.net> <4269777F.9010600@neurogami.com> Message-ID: <4269DA72.8020301@neurogami.com> George Moschovitis wrote: >>Thanks. I have to review and revise what I have already written, seeing >>how Nitro keeps changing (Damn you, George!). I'll send you a copy when >>the revisions are done. > > > Sorry for that James ;-) But at least Og will be pretty stabilized > from the next version on. Oh, quite alright. Better to get it right than fast. James From ilias at lazaridis.com Sat Apr 23 06:01:15 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 23 Apr 2005 13:01:15 +0300 Subject: [Nitro] Og update In-Reply-To: References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> Message-ID: George Moschovitis wrote: >>P.S. After looking at such a lot of really poor documentation (not from the >>standpoint of what's expected from an IBM reference manual, but from virtually any >>other) i've had the thought of volunteering to write documentation... if someone >>would be willing to *explain* to me how the thing to be documented works >>(iteratively, of course). It's a truism but anyone who knows how something works too >>well and/or learned it too long ago, is virtually incapable of doing good >>documentation, because they skip over too much that is so obvious to them that it >>exists beneath the level of conscious awareness. > > Should I consider this as an offer to write some documentation? :-) In > any case I will help you with any questions you have. Is there any reason for this discrimination? > regards, > George. . -- http://lazaridis.com From craig-duncan at earthlink.net Sat Apr 23 19:58:30 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Sat, 23 Apr 2005 19:58:30 -0400 Subject: [Nitro] Og update In-Reply-To: References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> Message-ID: <426AE126.7050807@earthlink.net> George Moschovitis wrote: >>P.S. After looking at such a lot of really poor documentation (not from the >>standpoint of what's expected from an IBM reference manual, but from virtually any >>other) i've had the thought of volunteering to write documentation... if someone >>would be willing to *explain* to me how the thing to be documented works >>(iteratively, of course). It's a truism but anyone who knows how something works too >>well and/or learned it too long ago, is virtually incapable of doing good >>documentation, because they skip over too much that is so obvious to them that it >>exists beneath the level of conscious awareness. > > > Should I consider this as an offer to write some documentation? :-) In > any case I will help you with any questions you have. > > regards, > George. Absolutely. Unfortunately, it doesn't seem likely i'm going to do like James and puzzle it out all on my lonesome. He has that ability more than i. I *do* have the ability to write very good documentation once i understand something. And i *can* figure things out. But figuring out ruby meta-programming is hard. And lots of people are content to just _sort of_ understand... enough for them to get something working given trying some number of random variations. Not me. When i understand something i *really* understand it. But it takes me longer. How can i get started with Nitro? I've read the Og stuff. And i haven't seen *anything* else. Nothing at all to get started with. I'd really like to see James intro and build on that. I'm thinking that DHH is really not doing the documentation thing right. The thing about that, though, is i don't think that he really cares. His ambitions (unfortunately, in my view) lie elsewhere and he's perfectly happy to let someone write some good documentation some months down the road as it means that *he* won't have to bother. That's fine if he were actually concerned about the current state of the documentation. But i don't see any indication that he is. In going through the mailing list, i've found questions that i thought were very useful in trying to draw him out into explaining some things on a more general, conceptual level, and after answering a very specific, detailed part of the question, he never even responded to the followup asking for further clarification. Anyway, the answer is yes. craig From craig-duncan at earthlink.net Sat Apr 23 20:03:58 2005 From: craig-duncan at earthlink.net (craig duncan) Date: Sat, 23 Apr 2005 20:03:58 -0400 Subject: [Nitro] Og update In-Reply-To: References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> Message-ID: <426AE26E.40000@earthlink.net> Ilias Lazaridis wrote: > George Moschovitis wrote: >> >> Should I consider this as an offer to write some documentation? :-) In >> any case I will help you with any questions you have. > > > Is there any reason for this discrimination? I seem like i'm willing to actually write some documentation? craig P.S. Have to be more careful with what the reply-to headers are set to (re my last message). From george.moschovitis at gmail.com Sun Apr 24 05:34:05 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 24 Apr 2005 12:34:05 +0300 Subject: [Nitro] Og update In-Reply-To: <426AE26E.40000@earthlink.net> References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> <426AE26E.40000@earthlink.net> Message-ID: there is no discrimination, i said in ANY case... I try to answer all the questions I get. At the moment I am really hard to finish a preview of the Og update. I plan to post a preview so that everyone on this list has a chance to comment on the new features and implementation. -g. On 4/24/05, craig duncan wrote: > Ilias Lazaridis wrote: > > George Moschovitis wrote: > >> > >> Should I consider this as an offer to write some documentation? :-) In > >> any case I will help you with any questions you have. > > > > > > Is there any reason for this discrimination? > > I seem like i'm willing to actually write some documentation? > > craig > > P.S. Have to be more careful with what the reply-to headers are set to (re my last > message). > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Sun Apr 24 10:14:53 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sun, 24 Apr 2005 17:14:53 +0300 Subject: [Nitro] Og update In-Reply-To: References: <426813DE.90907@neurogami.com> <42685C68.6010003@earthlink.net> <42690C85.1090208@earthlink.net> <426AE26E.40000@earthlink.net> Message-ID: George Moschovitis wrote: [...] >> Ilias Lazaridis wrote: >>> George Moschovitis wrote: >>> >>>> Should I consider this as an offer to write some documentation? >>>> :-) In any case I will help you with any questions you have. >>> >>> Is there any reason for this discrimination? > there is no discrimination, i said in ANY case... I try to answer all > the questions I get. I meant discrimitation of persons (me). I have made the same proposal, just one message above (and one month before) without such a positive reply from you. > At the moment I am really hard to finish a preview of the Og update. > I plan to post a preview so that everyone on this list has a chance > to comment on the new features and implementation. ok. It is possibly time to open an .devel group, where you can ask for assistance during your coding sessions. . -- http://lazaridis.com From george.moschovitis at gmail.com Mon Apr 25 03:31:07 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 25 Apr 2005 10:31:07 +0300 Subject: [Nitro] Misc, Message-ID: Paul, Craig, thanks for your remarks. IMHO, we should focus on development problems instead. For example your post exchange with James were very helpful for me while designing the new version of Og. I would like to hear more suggestions and even better problems with the current implementation of Nitro. For example Michael Neumann has been VERY helpful by pointing out several shortcomings of Og, more or less forcing me to take a step back, rethink on the implementation and try to offer solutions. I Hope to see more coding related posts in this list. I fully understand the problem with documentation, and realize that I promised proper documentation for a long time, but in about 2 weeks I 'll be pretty happy with the Nitro/Og API and I will really focus on the important documentation issue. I hope we will see some tutorial first (James? :)) but in any case be assured, I 'll do whats needed to make Nitro/Og more accessible to newcomers. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Mon Apr 25 04:25:53 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Mon, 25 Apr 2005 11:25:53 +0300 Subject: [Nitro] Misc, In-Reply-To: References: Message-ID: George Moschovitis wrote: > Paul, Craig, > > thanks for your remarks. IMHO, we should focus on development problems > instead. For example your post exchange with James were very helpful > for me while designing the new version of Og. [...] > For example Michael Neumann has been VERY helpful by pointing out > several shortcomings of Og, more or less forcing me to take a step > back, rethink on the implementation and try to offer solutions. I hope this will not delay things further. once more: please freeze and create a product (it can be changed afterwards, it's anyway alpha software). > I Hope to see more coding related posts in this list. I fully [...] this is a deadlock. provide an initial product, an auto-restructuring persistency library "OG", thus people can start working efficiently with persistent ruby objects. > regards, > George. . -- http://lazaridis.com From ilias at lazaridis.com Wed Apr 27 03:17:25 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Wed, 27 Apr 2005 10:17:25 +0300 Subject: [Nitro] Og update In-Reply-To: References: Message-ID: George Moschovitis wrote: > Hello all, > > I am planning an extensive update of the Og library. The api changes > will be minimal, but the new implementation will allow for some > *important* and some 'cool' new features. can you please post a status report? > Now is the time to send me your suggestions about things that are not > great in the current version, or ideas for new features. I plan to > work on this over the weekend. > > regards, > George. . -- http://lazaridis.com From ilias at lazaridis.com Wed Apr 27 04:16:47 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Wed, 27 Apr 2005 11:16:47 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: > I create a class, instantiate an object and save it within an > sqlite3. > > I retrieve this object. > > [the table was created, and I load the object back] > > > In the next step, I add a new "property" to the class. > > I instantiate an new object, and try to save it. > > but: the save fails with an "field not fould" exception. > > [the new property i've added] > > - > > How do I setup OG that it automaticaly match the table to the updated > class-definition? (= automaticly add columns). Implementation Suggestion: in pseudo-code: #------------------------------------- if store.freezed? return appStoreFreezedError for each store.classes (aClass) if not aClass.store.freezed? if not aClass.store.actual? aClass.store.restructure() next #------------------------------------- aClass::store::restructure() for each class.field (aField) action = aField.detectActionToPerform() if action # call action else # doNothing next # actions prioritized: # add fields to table # removde field (optionally keep removed fields) # change field type # execute "SQL restructure" #------------------------------------- store.addField(newField) # SQL TABLE ALTER - ADD COLUMN # http://www.sqlite.org/omitted.html #------------------------------------- - please let me know if I should refine this further. . -- http://lazaridis.com From paulha at aracnet.com Wed Apr 27 11:47:58 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Wed, 27 Apr 2005 08:47:58 -0700 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: <426FB42E.30301@aracnet.com> Ilias-- You might try searching this list for the problem you describe-- I've seen it mentioned here and George responded that there was a feature to automatically update the structure. He said it was presently turned off because he worried that it was a bit dangerous (and it is). The problem is that there are a variety of things that can happen that will change the structure of the table, and the meta information to know how to handle each case is not there. Adding a new field is relatively clean, so it dropping one. But renaming a field looks like a drop /and/ an add, and a naieve implementation will loose data rather than rename the field as desired. For now, I believe that you have to manually update changes to the table structure once Og has created it. Paul Ilias Lazaridis wrote: > Ilias Lazaridis wrote: > >> I create a class, instantiate an object and save it within an >> sqlite3. >> >> I retrieve this object. >> >> [the table was created, and I load the object back] >> >> >> In the next step, I add a new "property" to the class. >> >> I instantiate an new object, and try to save it. >> >> but: the save fails with an "field not fould" exception. >> >> [the new property i've added] >> >> - >> >> How do I setup OG that it automaticaly match the table to the updated >> class-definition? (= automaticly add columns). > > > Implementation Suggestion: > > in pseudo-code: > > #------------------------------------- > > if store.freezed? > return appStoreFreezedError > > for each store.classes (aClass) > > if not aClass.store.freezed? > if not aClass.store.actual? > aClass.store.restructure() > > next > > #------------------------------------- > > aClass::store::restructure() > > for each class.field (aField) > > action = aField.detectActionToPerform() > if action > # call action > else > # doNothing > > next > > # actions prioritized: > # add fields to table > # removde field (optionally keep removed fields) > # change field type > # execute "SQL restructure" > > #------------------------------------- > > store.addField(newField) > # SQL TABLE ALTER - ADD COLUMN > # http://www.sqlite.org/omitted.html > > #------------------------------------- > > - > > please let me know if I should refine this further. > > . > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050427/58edc238/attachment.html From ilias at lazaridis.com Wed Apr 27 11:58:28 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Wed, 27 Apr 2005 18:58:28 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: <426FB42E.30301@aracnet.com> References: <426FB42E.30301@aracnet.com> Message-ID: PAUL HANCHETT wrote: > Ilias-- > > You might try searching this list for the problem you describe-- I don't have to. I've raised this issue. > I've > seen it mentioned here and George responded that there was a feature to > automatically update the structure. He said it was presently turned off > because he worried that it was a bit dangerous (and it is). you are not up-to-date. please review the latest threads. > The problem is that there are a variety of things that can happen that [...] - (obvious/irrelevant stuff) I've suggested what is trivial: implementing initially "add field" and "remove field". > For now, I believe that you have to manually update changes to the table > structure once Og has created it. what you believe is irrelevant. I'm awaiting the reply of an developer. [posted it here as no developer-list available]. > Paul > > > Ilias Lazaridis wrote: > >> Ilias Lazaridis wrote: >> >>> I create a class, instantiate an object and save it within an >>> sqlite3. >>> >>> I retrieve this object. >>> >>> [the table was created, and I load the object back] >>> >>> >>> In the next step, I add a new "property" to the class. >>> >>> I instantiate an new object, and try to save it. >>> >>> but: the save fails with an "field not fould" exception. >>> >>> [the new property i've added] >>> >>> - >>> >>> How do I setup OG that it automaticaly match the table to the updated >>> class-definition? (= automaticly add columns). >> >> >> >> Implementation Suggestion: >> >> in pseudo-code: >> >> #------------------------------------- >> >> if store.freezed? >> return appStoreFreezedError >> >> for each store.classes (aClass) >> >> if not aClass.store.freezed? >> if not aClass.store.actual? >> aClass.store.restructure() >> >> next >> >> #------------------------------------- >> >> aClass::store::restructure() >> >> for each class.field (aField) >> >> action = aField.detectActionToPerform() >> if action >> # call action >> else >> # doNothing >> >> next >> >> # actions prioritized: >> # add fields to table >> # removde field (optionally keep removed fields) >> # change field type >> # execute "SQL restructure" >> >> #------------------------------------- >> >> store.addField(newField) >> # SQL TABLE ALTER - ADD COLUMN >> # http://www.sqlite.org/omitted.html >> >> #------------------------------------- >> >> - >> >> please let me know if I should refine this further. >> >> . >> > > > ------------------------------------------------------------------------ > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -- http://lazaridis.com From paulha at aracnet.com Wed Apr 27 12:11:21 2005 From: paulha at aracnet.com (PAUL HANCHETT) Date: Wed, 27 Apr 2005 09:11:21 -0700 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: <426FB42E.30301@aracnet.com> Message-ID: <426FB9A9.9060504@aracnet.com> Sorry Ilias, you're going onto my Spam list. Bye. Ilias Lazaridis wrote: > PAUL HANCHETT wrote: > >> Ilias-- >> >> You might try searching this list for the problem you describe-- > > > I don't have to. > > I've raised this issue. > >> I've seen it mentioned here and George responded that there was a >> feature to automatically update the structure. He said it was >> presently turned off because he worried that it was a bit dangerous >> (and it is). > > > you are not up-to-date. > > please review the latest threads. > >> The problem is that there are a variety of things that can happen that > > [...] - (obvious/irrelevant stuff) > > I've suggested what is trivial: > > implementing initially "add field" and "remove field". > >> For now, I believe that you have to manually update changes to the >> table structure once Og has created it. > > > what you believe is irrelevant. > > I'm awaiting the reply of an developer. > > [posted it here as no developer-list available]. > >> Paul >> >> >> Ilias Lazaridis wrote: >> >>> Ilias Lazaridis wrote: >>> >>>> I create a class, instantiate an object and save it within an >>>> sqlite3. >>>> >>>> I retrieve this object. >>>> >>>> [the table was created, and I load the object back] >>>> >>>> >>>> In the next step, I add a new "property" to the class. >>>> >>>> I instantiate an new object, and try to save it. >>>> >>>> but: the save fails with an "field not fould" exception. >>>> >>>> [the new property i've added] >>>> >>>> - >>>> >>>> How do I setup OG that it automaticaly match the table to the updated >>>> class-definition? (= automaticly add columns). >>> >>> >>> >>> >>> Implementation Suggestion: >>> >>> in pseudo-code: >>> >>> #------------------------------------- >>> >>> if store.freezed? >>> return appStoreFreezedError >>> >>> for each store.classes (aClass) >>> >>> if not aClass.store.freezed? >>> if not aClass.store.actual? >>> aClass.store.restructure() >>> >>> next >>> >>> #------------------------------------- >>> >>> aClass::store::restructure() >>> >>> for each class.field (aField) >>> >>> action = aField.detectActionToPerform() >>> if action >>> # call action >>> else >>> # doNothing >>> >>> next >>> >>> # actions prioritized: >>> # add fields to table >>> # removde field (optionally keep removed fields) >>> # change field type >>> # execute "SQL restructure" >>> >>> #------------------------------------- >>> >>> store.addField(newField) >>> # SQL TABLE ALTER - ADD COLUMN >>> # http://www.sqlite.org/omitted.html >>> >>> #------------------------------------- >>> >>> - >>> >>> please let me know if I should refine this further. >>> >>> . >>> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050427/432d448f/attachment.html From ilias at lazaridis.com Wed Apr 27 12:20:48 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Wed, 27 Apr 2005 19:20:48 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: <426FB9A9.9060504@aracnet.com> References: <426FB42E.30301@aracnet.com> <426FB9A9.9060504@aracnet.com> Message-ID: PAUL HANCHETT wrote: > Sorry Ilias, you're going onto my Spam list. Bye. ??? ok, bye. . -- http://lazaridis.com From george.moschovitis at gmail.com Wed Apr 27 14:01:51 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 27 Apr 2005 21:01:51 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: <426FB42E.30301@aracnet.com> References: <426FB42E.30301@aracnet.com> Message-ID: > Adding a new field is relatively clean, so > it dropping one. But renaming a field looks like a drop and an add, and a > naieve implementation will loose data rather than rename the field as > desired. As I said, I had a version that handled some trivial and some not so trivial cases. I haven thought a lot about this lately. I 'll review Ilias suggestion though. > For now, I believe that you have to manually update changes to the table > structure once Og has created it. Yeap, for the moment you have to manually update the field(s). But this is typicaly relatively easy to do. -g. -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Wed Apr 27 14:04:32 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 27 Apr 2005 21:04:32 +0300 Subject: [Nitro] Og update In-Reply-To: References: Message-ID: > can you please post a status report? The new Og is advancing quite nicely. I 'll release more details on the coming Monday. I plan for a release some time in next week. regards, George. -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Wed Apr 27 14:35:45 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Wed, 27 Apr 2005 21:35:45 +0300 Subject: [Nitro] Og update In-Reply-To: References: Message-ID: George Moschovitis wrote: >>can you please post a status report? > > The new Og is advancing quite nicely. I 'll release more details on > the coming Monday. I plan for a release some time in next week. you will run again and again into problems, if you do not increase your ability to decouple/isolate tasks. the "add/remove-field" issue was a non-critical issue, which could be added seperately from other redesign issues. you have lost at least one potential user (me) due to this delay. > regards, > George. . -- http://lazaridis.com From ak at navel.gr Wed Apr 27 21:17:00 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 28 Apr 2005 04:17:00 +0300 Subject: [Nitro] BUG: incorrect syntax can break Message-ID: <4270398C.9000607@navel.gr> arghh.... if you're working late and write instead of in one of your templates, be warned: the nitro engine falls into an infinite loop which would be very difficult to trace down. pls fix this! Tasos Koutoumanos From george.moschovitis at gmail.com Thu Apr 28 03:17:51 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 28 Apr 2005 10:17:51 +0300 Subject: [Nitro] BUG: incorrect syntax can break In-Reply-To: <4270398C.9000607@navel.gr> References: <4270398C.9000607@navel.gr> Message-ID: Hmm... sorry for this, I 'll fix it ASAP! thanks for the report. -g. On 4/28/05, Anastasios Koutoumanos wrote: > arghh.... if you're working late and write instead > of in one of your templates, be warned: the nitro > engine falls into an infinite loop which would be very difficult to > trace down. > > pls fix this! > > Tasos Koutoumanos > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Thu Apr 28 04:20:15 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Thu, 28 Apr 2005 11:20:15 +0300 Subject: [Nitro] [OG] [JAMPERSIST] - Enabling Quick Evaluation Message-ID: Without the schema-auto-update, I cannot complete the template, as instructions like "delete table manually" etc. render Og useless. Think about the impression an evaluator get's. I mean an evaluator, who is the CTO of a company, and which a employee tries to convice about using ruby & og & ... - http://lazaridis.com/case/persist/og.html - I would like to add this functionality myself to the codebas (og 0.16). Can I rely on the assistance of the developers (just if I have questions about the code / structure etc.)? . -- http://lazaridis.com From ak at navel.gr Thu Apr 28 04:34:50 2005 From: ak at navel.gr (Anastasios Koutoumanos) Date: Thu, 28 Apr 2005 11:34:50 +0300 Subject: [Nitro] [OG] [JAMPERSIST] - Enabling Quick Evaluation In-Reply-To: References: Message-ID: <4270A02A.6080509@navel.gr> Ilias Lazaridis wrote: > Without the schema-auto-update, I cannot complete the template, as > instructions like "delete table manually" etc. render Og useless. > > Think about the impression an evaluator get's. > > I mean an evaluator, who is the CTO of a company, and which a employee > tries to convice about using ruby & og & ... > > - > > http://lazaridis.com/case/persist/og.html > > - > > I would like to add this functionality myself to the codebas (og 0.16). i believe you've noticed the posts mentioning that G. is currently works on og. therefore i suggest you restrain from diggind into the code until the new version is released. tasos koutoumanos > > Can I rely on the assistance of the developers (just if I have > questions about the code / structure etc.)? > > . > From ilias at lazaridis.com Thu Apr 28 04:54:56 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Thu, 28 Apr 2005 11:54:56 +0300 Subject: [Nitro] [OG] [JAMPERSIST] - Enabling Quick Evaluation In-Reply-To: <4270A02A.6080509@navel.gr> References: <4270A02A.6080509@navel.gr> Message-ID: Anastasios Koutoumanos wrote: > Ilias Lazaridis wrote: > >> Without the schema-auto-update, I cannot complete the template, as >> instructions like "delete table manually" etc. render Og useless. >> >> Think about the impression an evaluator get's. >> >> I mean an evaluator, who is the CTO of a company, and which a employee >> tries to convice about using ruby & og & ... >> >> - >> >> http://lazaridis.com/case/persist/og.html >> >> - >> >> I would like to add this functionality myself to the codebas (og 0.16). > > i believe you've noticed the posts mentioning that G. is currently works > on og. therefore i suggest you restrain from diggind into the code until > the new version is released. I believe you've noticed the posts mentioning my doubts about your processing model and my time-limits (I've initialized this evaluation on 2005-02-17). I can make the "add field" automatism within estimated 2 to 4 hours, if I have some answers of the the developers. So, my question remains: >> Can I rely on the assistance of the developers (just if I have >> questions about the code / structure etc.)? ? -- http://lazaridis.com From ilias at lazaridis.com Thu Apr 28 15:06:50 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Thu, 28 Apr 2005 22:06:50 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: > Ilias Lazaridis wrote: > >> I create a class, instantiate an object and save it within an >> sqlite3. >> >> I retrieve this object. >> >> [the table was created, and I load the object back] >> >> >> In the next step, I add a new "property" to the class. >> >> I instantiate an new object, and try to save it. >> >> but: the save fails with an "field not fould" exception. >> >> [the new property i've added] >> >> - >> >> How do I setup OG that it automaticaly match the table to the updated >> class-definition? (= automaticly add columns). [I'm not familar with SQL and the sqlite-ruby. I would need assistance in executing the SQL and getting standard ruby objects] within sqlite.rb # ------------------------------------------------- # Helper Methods # ------------------------------------------------- def table_exists?(tablename) # implementation based on: # http://www.sqlite.org/pragma.html#schema end # ------------------------------------------------- def table_fields(tablename) # implementation based on: # http://www.sqlite.org/pragma.html#schema end # ------------------------------------------------- def column_add(column_definition) #implementation based on: #http://www.sqlite.org/lang_altertable.html end # ------------------------------------------------- def column_delete(column_definition) # currently not directly implementable # column can remain within table # http://www.sqlite.org/lang_altertable.html end # ------------------------------------------------- # New Core Method # ------------------------------------------------- def update_table(kalss,db) conn = db.get_connection fields = create_fields(klass) fields = create_fields(klass) table_fields = table_fields_get(klass::DTABLE) # loop to compare fields/table_fields # call to column_add / column_delete # execute sql # cleanup end # ------------------------------------------------- # Existend Core Method # ------------------------------------------------- def create_table(klass,db) conn = db.get_connection fields = create_fields(klass) if table_exists?(klass::DBTABLE) # cleanup update_table() end # ------------------------------------------------- Additionally, the the answer to the question in code: "# gmosx: any idea how to better test this?" should be this: http://www.sqlite.org/pragma.html#schema > Implementation Suggestion: > > in pseudo-code: > > #------------------------------------- > > if store.freezed? > return appStoreFreezedError > > for each store.classes (aClass) > > if not aClass.store.freezed? > if not aClass.store.actual? > aClass.store.restructure() > > next > > #------------------------------------- > > aClass::store::restructure() > > for each class.field (aField) > > action = aField.detectActionToPerform() > if action > # call action > else > # doNothing > > next > > # actions prioritized: > # add fields to table > # removde field (optionally keep removed fields) > # change field type > # execute "SQL restructure" > > #------------------------------------- > > store.addField(newField) > # SQL TABLE ALTER - ADD COLUMN > # http://www.sqlite.org/omitted.html > > #------------------------------------- > > - > > please let me know if I should refine this further. > > . > -- http://lazaridis.com From james_b at neurogami.com Thu Apr 28 17:39:39 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 28 Apr 2005 14:39:39 -0700 Subject: [Nitro] [OT] AOP blog Message-ID: <4271581B.6020201@neurogami.com> Given the use of AOP in Nitro/Og, I thought this might be of interest. http://www.aspectprogrammer.org/blogs/adrian/ James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com From transfire at gmail.com Fri Apr 29 00:57:48 2005 From: transfire at gmail.com (TRANS) Date: Fri, 29 Apr 2005 00:57:48 -0400 Subject: [Nitro] [OT] AOP blog In-Reply-To: <4271581B.6020201@neurogami.com> References: <4271581B.6020201@neurogami.com> Message-ID: <4b6f054f05042821575cbb1d7e@mail.gmail.com> On 4/28/05, James Britt wrote: > Given the use of AOP in Nitro/Og, I thought this might be of interest. > > http://www.aspectprogrammer.org/blogs/adrian/ Interesting link. Thanks. Also, can demonstrate some Nitro AOP? It would be cool to see some basic code examples. Thanks, T. From george.moschovitis at gmail.com Fri Apr 29 11:23:11 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 29 Apr 2005 18:23:11 +0300 Subject: [Nitro] [OT] AOP blog In-Reply-To: <4271581B.6020201@neurogami.com> References: <4271581B.6020201@neurogami.com> Message-ID: Thanks James, looks really interesting! Btw, the new Og will use aspects for logging too... -g. On 4/29/05, James Britt wrote: > Given the use of AOP in Nitro/Og, I thought this might be of interest. > > http://www.aspectprogrammer.org/blogs/adrian/ > > James > > -- > > http://www.ruby-doc.org > http://www.rubyxml.com > http://catapult.rubyforge.com > http://orbjson.rubyforge.com > http://ooo4r.rubyforge.com > http://www.jamesbritt.com > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From george.moschovitis at gmail.com Fri Apr 29 11:25:08 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 29 Apr 2005 18:25:08 +0300 Subject: [Nitro] [OT] AOP blog In-Reply-To: <4b6f054f05042821575cbb1d7e@mail.gmail.com> References: <4271581B.6020201@neurogami.com> <4b6f054f05042821575cbb1d7e@mail.gmail.com> Message-ID: have a look at: lib/og/mixin/timestamped.rb or (even better) test/glue/tc_aspects.rb regards, George. On 4/29/05, TRANS wrote: > On 4/28/05, James Britt wrote: > > Given the use of AOP in Nitro/Og, I thought this might be of interest. > > > > http://www.aspectprogrammer.org/blogs/adrian/ > > Interesting link. Thanks. Also, can demonstrate some Nitro AOP? It > would be cool to see some basic code examples. > > Thanks, > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Fri Apr 29 12:59:21 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Fri, 29 Apr 2005 19:59:21 +0300 Subject: [Nitro] [OG] [JAMPERSIST] - Enabling Quick Evaluation In-Reply-To: References: <4270A02A.6080509@navel.gr> Message-ID: Ilias Lazaridis wrote: > Anastasios Koutoumanos wrote: >> Ilias Lazaridis wrote: >> >>> Without the schema-auto-update, I cannot complete the template, as >>> instructions like "delete table manually" etc. render Og useless. >>> >>> Think about the impression an evaluator get's. >>> >>> I mean an evaluator, who is the CTO of a company, and which a >>> employee tries to convice about using ruby & og & ... >>> >>> - >>> >>> http://lazaridis.com/case/persist/og.html >>> >>> - >>> >>> I would like to add this functionality myself to the codebas (og 0.16). >> >> i believe you've noticed the posts mentioning that G. is currently >> works on og. therefore i suggest you restrain from diggind into the >> code until the new version is released. > > I believe you've noticed the posts mentioning my doubts about your > processing model and my time-limits (I've initialized this evaluation on > 2005-02-17). > > I can make the "add field" automatism within estimated 2 to 4 hours, if > I have some answers of the the developers. > > So, my question remains: > >>> Can I rely on the assistance of the developers (just if I have >>> questions about the code / structure etc.)? > > ? Looks like the answer is no. . -- http://lazaridis.com From ilias at lazaridis.com Sat Apr 30 13:20:16 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 30 Apr 2005 20:20:16 +0300 Subject: [Nitro] [OG] - OID should be first field Message-ID: I'm wondering about some issues within the source-code. Shouldn't "OID" be the first filed within a table? . -- http://lazaridis.com From george.moschovitis at gmail.com Sat Apr 30 13:37:26 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 30 Apr 2005 20:37:26 +0300 Subject: [Nitro] [OG] - OID should be first field In-Reply-To: References: Message-ID: It would be nice, but I think this is hard to do. Btw, this less relevant in the new Og version which allows you to specify the primary key if you want. -g. On 4/30/05, Ilias Lazaridis wrote: > I'm wondering about some issues within the source-code. > > Shouldn't "OID" be the first filed within a table? > > . > > -- > http://lazaridis.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://nitro.rubyforge.org http://www.joy.gr From ilias at lazaridis.com Sat Apr 30 14:00:12 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 30 Apr 2005 21:00:12 +0300 Subject: [Nitro] [OG] - OID should be first field In-Reply-To: References: Message-ID: George Moschovitis wrote: > On 4/30/05, Ilias Lazaridis wrote: > >> I'm wondering about some issues within the source-code. >> >> Shouldn't "OID" be the first filed within a table? >> > It would be nice, I think this is essential. > but I think this is hard to do. why? > Btw, this less > relevant in the new Og version which allows you to specify the > primary key if you want. I started to like the neutral entity "OID" - but having the flexibitily to ommit it, is fine . -- http://lazaridis.com From ilias at lazaridis.com Sat Apr 30 14:21:06 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 30 Apr 2005 21:21:06 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: > Ilias Lazaridis wrote: >> Ilias Lazaridis wrote: >> >>> I create a class, instantiate an object and save it within an >>> sqlite3. >>> >>> I retrieve this object. >>> >>> [the table was created, and I load the object back] >>> >>> >>> In the next step, I add a new "property" to the class. >>> >>> I instantiate an new object, and try to save it. >>> >>> but: the save fails with an "field not fould" exception. >>> >>> [the new property i've added] >>> >>> - >>> >>> How do I setup OG that it automaticaly match the table to the updated >>> class-definition? (= automaticly add columns). see code below for a partial solution (one step missing to become functional for "add field"). > > [I'm not familar with SQL and the sqlite-ruby. I would need assistance > in executing the SQL and getting standard ruby objects] > within sqlite.rb #---------------------------------------------------------------------------- def table_fields(klass, db) conn = db.get_connection() tfields = [] begin conn.store.table_info( klass::DBTABLE ) {|field| tfields << field } rescue Exception => ex # exception handling end return tfields end #---------------------------------------------------------------------------- def table_field_count(klass, db) # returns number of fields defined in a table, 0 if none (table non-existent) conn = db.get_connection() counter = 0 begin conn.store.table_info( klass::DBTABLE) {|field| counter += 1 } rescue Exception => ex #TODO exception handling end return counter end #---------------------------------------------------------------------------- def field_exists(field, tfield, idx) val = tfield[idx][1] + ' ' + tfield[idx][2] if val == field[idx] return true else return false end end #---------------------------------------------------------------------------- def field_process(field,tfield) for idx in field.size if field_exists(field, tfield, idx) p fiedl[idx] # sql_alter_table end end #execute sql #execute end #--------------------------------------------------------------------------- - I cannot find the "alter table" command within the sqlite3-ruby library. any ideas? - the code is partially untested (field process method) [btw: it is not funny to invest time without getting any feedback.] - > # ------------------------------------------------- > # Existend Core Method > # ------------------------------------------------- > > def create_table(klass,db) > > conn = db.get_connection > > fields = create_fields(klass) > > if table_exists?(klass::DBTABLE) > # cleanup > update_table() > end > > # ------------------------------------------------- > > Additionally, the the answer to the question in code: > > "# gmosx: any idea how to better test this?" > > should be this: see method "table_field_count" >> please let me know if I should refine this further. ? . -- http://lazaridis.com From ilias at lazaridis.com Sat Apr 30 14:41:47 2005 From: ilias at lazaridis.com (Ilias Lazaridis) Date: Sat, 30 Apr 2005 21:41:47 +0300 Subject: [Nitro] [OG] - Automated table modification / extension In-Reply-To: References: Message-ID: Ilias Lazaridis wrote: [...] > How do I setup OG that it automaticaly match the table to the updated > class-definition? (= automaticly add columns). after testing a little bit within the OG codebase: - At least SQLite3 has very limited support for table alteration. The better alternative would be possibly: if table_exist table_create() # standard create method, suffix "_new" table_copy() # generic copy method, usable for db-migration, too transaction table_rename() # _old table_rename() # _new => table_delete() # delete old table end end . -- http://lazaridis.com