[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: perl OO API?



Hi Klavs;

I am going to describe where we are going here with the API.  We have
abandoned all appearances of supporting any db's other than PostgreSQL
and will be re-engineering the API over the next year or so.  1.3 will
be the first release with some of the API re-written.

You can divide the logic of the application into really a few areas:
1)  Data logic (M)
2)  UI Generation (V)
3)  Application logic (C)


Most of what is in the SQL-Ledger PM's at the moment is data logic.
Data logic will be moved entirely into the db via stored procedures to
the greatest extent practical.  A very light-weight object model will
sit on top of these.

UI Generation is going to be done in Template Toolkit at first and
then XML/XSLT as the API matures.  We will probably support  both TT
and XML/XSLT in parallel.  The RESTful API is essentially treated as a
UI.

I assume that by the time 1.3 comes out, we will have a better idea of
what sort of logic the application still has to handle outside this.
Certainly authentication and some other areas need to be looked at
here.  Once we really start moving to this model, we will probably
find that most of this is simple proceedural stuff.

Note that since most of the data logic will be contained in the db, it
will be trivial to write other apps that interact with LedgerSMB in
any other language.

Hope this helps, and sorry for the delay.

Best Wishes,
Chris

On 12/22/06, Klavs Klavsen <..hidden..> wrote:
Hi guys,

I started a project, called OpenLedger last year, but got a lot of jobs
as a consultant, which meant I didn't have as much time as I used too -
and also I got as far in the project that it was usable to me - so had
to give it a lower priority :(

http://openledger.sourceforge.net/

I would like to work on getting this API to work for LedgerSMB - as I'd
like to switch to using LedgerSMB, and I currently use this API for two
things:
1) integration with OSCommerce - via perl scripts that create invoices
for orders in oscommerce.
2) automaticly (depending on when their subscriptions needs renewal)
creating invoices for customers and emailing to them as PDF.

My vision with OpenLedger was:
Produce a nice perl-based API, which is to be the ONLY way to
interact with the SL data - no matter if it's the webinterface or some
third-part program that accesses it (and f.ex. python-based programs can
use the perl-based API too  :)

The idea here, is that this would make it easy for other programs to
integrate with the accounting system - and also clean up the mess that
is the SQLLedger code (where GUI and business/data handling code is
totally intertwined).

The openledger project also showed how easy it was to create a SOAP
interface to the API (there's an example in the openledger CVS).

I would very much like to hear your thoughts and ideas and hope we can
find some agreement on how you'd like this done - as I would very much
like there to be a real Free Software Accounting project, with great
functionality and I'd like to help this along, as it would also help me
with my own business needs.

I could ofcourse just continue using SQLLedger, with all its security
bugs (just hide it behind basic auth) - but that's just ugly IMHO.

p.s. I'm open to any object vs. function-based arguments - I'm a fan of
OO and like the abilities (incl. abstraction) it gives you.

In my opinion, Object-Oriented code, if done right, will enable the API
to be the same (and thus not forcing projects using it to change their
code all the time), and being easy to expand using new objects/methods
and polymorfing functions when an extra parameter is needed for same
method etc.

--
Regards,
Klavs Klavsen, GSEC, ..hidden.., http://www.EnableIT.dk
Open Source Server, Security and Network Consulting
Phone: +45 364 812 00 Mobile: +45 612 812 00

"Open Source Software - Sometimes you get more than you paid for."

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel