[Building Sakai] sakai technical flow and business (request) flow from front-end to back-end(database)

Mark Norton markjnorton at earthlink.net
Thu Sep 24 06:48:50 PDT 2009


Sakai uses a service layer architecture.  At the top are applications 
(registered Sakai tools).  Part of the tool registration process makes 
Sakai components available to the tool, via the ComponentManager.  Many 
of these components are implementations of Sakai services.  Services, in 
general, are designed to manage persistent data.

Consider getting information about a user.  The active user is included 
in a Sakai session, but is easily accessed via 
UserDirectoryService.getCurrentUser();  You can get the 
UserDirectoryService in several ways (Spring injection, a cover, or via 
the ComponentManager.  The UserDirectorySevice is an API with an 
implementation:  DbUserService, which extends BaseUserService.

Sakai supports multiple databases, which somewhat complicates the access 
picture.  If Sakai is configured to use Oracle, for example, the request 
is passed off to UseServiceSqlOracle (there are three other flavors of 
this for MySQL, Microsoft, and Hypersonic).  There, a query is made 
using a JDBC connection drawn from a pool of such.

Of itself, this is a straightforward, layered access to a database via 
stacked Java packages.  In this particular case, though, it is 
complicated by the fact that many Sakai installations save information 
in places other than the Sakai database.  If configured, a user provider 
implementation is called that can draw information in from LDAP or some 
other external enterprise service.

The key lesson to take away from all this is that Sakai has provided 
well-defined Java services to access data.  The actual database table 
definitions and SQL statements are deliberately hidden from developers 
and are subject to change from release to release.  For this reason, 
direct access to information in the Sakai database is discouraged.  The 
above example shows why:  not all user information is kept in the database.

- Mark Norton

PS.  Becoming a Sakai developer has a learning curve of it's own.  There 
is a considerable amount of documentation on the technical aspects of 
Sakai in Confluence and other places.  Much of the response I made above 
can be found in the architecture documents distributed with Sakai (see 
https://source.sakaiproject.org/svn/reference/trunk/docs/architecture/).  
You might want to read them.  In addition to documentation, there are 
other ways to come up to speed on Sakai.  You can get technical training 
from several people (including myself).  You can also hire knowledgeable 
Sakai consultants (see 
http://confluence.sakaiproject.org/display/MGT/Sakai+Consultants). 

The people who monitor this list are developers.  That means they have 
lots of things to do.  While most are willing to answer relevant 
questions, they are not generally interested in providing answers to 
questions that can be found by a simple search in Confluence.


Ravinder Kankanala wrote:
>
> HI team,
>
>  
>
> We are unable to understand how request goes from front-end to back 
> end(database)  and how internally calls from one tier to another tier.
>
>  
>
> Please take one example and explain me please.
>
>  
>
> We need technical request flow please share with you inputs.
>
>  
>
>  
>
> Thanks
>
> Ravinder
>
> DISCLAIMER ========== This e-mail may contain privileged and 
> confidential information which is the property of Persistent Systems 
> Ltd. It is intended only for the use of the individual or entity to 
> which it is addressed. If you are not the intended recipient, you are 
> not authorized to read, retain, copy, print, distribute or use this 
> message. If you have received this communication in error, please 
> notify the sender and delete all copies of this message. Persistent 
> Systems Ltd. does not accept any liability for virus infected mails.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"



More information about the sakai-dev mailing list