[ANN] Nitro + Og 0.15.0, Localization, Parametrized mixins, Morphing, SQLServer

  • Thread starter George Moschovitis
  • Start date
G

George Moschovitis

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:

<h1>[[This is a localized]] String</h1>
<p>
do you [[:like]] this?
</p>

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:

<div if="admin">
admin interface
</div>

<ul>
<li each="u in @users">#{u.first_name} #{u.last_name}
</ul>

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.


Nitro is an efficient, yet simple engine for developing professional
Web Applications using the Ruby language. Nitro aims to provide a
robust infrastructure for scalable web applications that can be
distributed over a server cluster. However, Nitro can also power simple
web applications for deployment on intranets or even personal
computers. Nitro integrates the powerful Og Object-Relational mapping
library.

Nitro is a multiparadigm application framework and will integrate ideas
from Rails, Wee, PHP, JSP and .NET

Nitro integrates the Og (ObjectGraph) object-relational mapping
library. Og provides transparent serialization of object graphs to an
RDBMS backend. Unlike other similar libraries Og maps standard Ruby
objects to SQL tables and not vice versa. Og provides a meta language
to describe the relations between objects, a flexible and intuitive APY
for querying the database, raw access to the SQL language if needed
(for example to fine tune the automatically generated SQL tables, or
for custom queries), suports deserialization to Ruby objects or tuples,
automatically generates join tables for many_to_many relations and
provides a collection of usefull Mixins to synthesize common Entities.

Og is a combination of the best features of Active Record and the
former O-R mapping library included in Nitro (NDB). Adapters for
PostgreSQL, MySQL, SQLite and Oracle are included.

I hope this software will be useful for you, and I would love to
receive your suggestions, ideas and bug reports.

have fun,
George Moschovitis
 
G

George Moschovitis

Hello,

If you try this in practice, it is even nicer :)
Nice idea. You could use also this to propagate operations (e.g. delete,
aggregating ops, others) along specific attribute or relations.

this will be used extensively in future versions, stay tuned.
What does this do to the tables? Can Comment include 'Orderable' multiple
times with different :scopes? How about ordering on either end of N-M
relations?

this adds columns to the tables. A parametrized mixin can be included
multiple times with different parameters.
Which ideas from Wee does it currently have? Which ones would you like it to
have :)?

At the moment:

- support for programmatic rendering paradigm.

We plan to have:

- source code as clean as Wee.
- even more powerfull programmtic renderer (using multiblocks)
- flow management (possibly with similar continuation emulation)
- Components (however this will be implemented quite different,
utilising a clever idea from Dan Yoder, you will LIKE this :))


regards,
George.
 
D

Dave Burt

George Moschovitis said:
new versions of Nitro and Og were just released.
...
* 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.

...
Nitro is a multiparadigm application framework and will integrate ideas
from Rails, Wee, PHP, JSP and .NET

I've heard a bunch of cool things about the Nitro/Og framework, and am
wondering a couple of things:

What are the implications of a "multiparadigm" framework on the "best way"
to write a Nitro/Og app?

Where should I go to get started quickly, to get a taste of the framework?

Cheers,
Dave
 
G

George Moschovitis

What are the implications of a "multiparadigm" framework on the "best way"
to write a Nitro/Og app?

The main implication is that Nitro tries to avoid forcing too many
design decisions to the developer. However we also provide some rational
defaults (that the user can override). In short you don't HAVE to use
MVC, you don't have to follow a particular directory structure, you can
write php style code if you want (useful for small projects) etc.

As Nitro matures, it will provide even more freedom.
Where should I go to get started quickly, to get a taste of the framework?

Please download the latest version, and try the examples. You can also
read the Og tutorial (www.rubygarden.com) and participate in the
nitro-general mailing list (nitro.rubyforge.org).

However, Nitro tutorials and documentation are coming (real) soon. We
will also document the "best of practice" way to develop Nitro
applications.

George.
 
M

Michael Neumann

Am Dienstag 05 April 2005 22:04 schrieb itsme213:
George Moschovitis said:
multiple


this adds columns to the tables. A parametrized mixin can be included
multiple times with different parameters.

Does it allow duck-typing?

class Posting

# response can be Approval or Disapproval
# no inheritance relation require

has_many :responses, [Approval, Disapproval]

include Orderable, :scope => responses

end

Yeah, *please* add duck typing!

Regards,

Michael
 
G

George Moschovitis

Does it allow duck-typing?
class Posting
...
has_many :responses, [Approval, Disapproval]
end

I cannot understand what you mean. Can you please explain this a little
better?

Thanks in advanvce,
George.
 
M

Michael Neumann

Am Dienstag 05 April 2005 22:19 schrieb George Moschovitis:
Does it allow duck-typing?
class Posting
...
has_many :responses, [Approval, Disapproval]
end

I cannot understand what you mean. Can you please explain this a little
better?

"Syntax-sugar" for:

class Posting

has_many :approval_responses, Approval
has_many :disapproval_responses, Disapproval

def responses
self.approval_responses + self.disapproval_responses
end

def add_response(r)
case r
when Approval
add_approval_response(r)
when Disapproval
add_disapproval_response(r)
else
raise
end
end

end

And if you could hide the meta for the :approval_responses
and :disapproval_responses, this would be even better.

Regards,

Michael
 
G

George Moschovitis

Hmm,

I understand what you want, but not why this is so useful. Anyway I 'll
try to add this. If possible please add a feature request (just copy
paste this text) so I will not forget it. (I get a lot of suggestions
lately :))

thanks,
George.
 
G

George Moschovitis

It would be really **awesome** if you could add this to og.

even though I cannot see why this is so useful, I 'll try to add this
:)
stay tunned!

-g.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top