As previously mentioned, the best way is to simply do it. Once you get out of the Mysqli / Mysql way of handling databases and use xPDO (PDO) you will never look back. Code reduction is as much as 80%.
Take a look at this:
http://www.shawnwilkerson.com/modx-revolution/2012/03/10/programmatically-working-with-the-moduser-object/
It plays with the modUser object.
Study the modUser portion of the schema paying attention to the aggregate and composite relationships.
Also look at
https://forums.modx.com/thread/85383/how-do-i-set-contents-of-external-db-to-custom-placeholders#dis-post-471191 for a cheat snippet to get a schema parsed.
Remember, it should be located in: /core/components/PACKAGE_NAME/model/schema
And named (in all lower case): PACKAGE_NAME.mysql.schema.xml
The primary barrier most people I have helped with xPDO is they are over-thinking and complicating the xPDO process. It actually is pretty straight forward once you understand you don't really need to think of the database and data as separate entities any longer.
xPDO allows developers to think of primarily the data and only passively the database.
To better explain:
I have a client table (for brevity we will just use the modUser).
Once I defined and created from xPDO,I typically only have to think user.... What do I need or want from it. I don't have to think so much of how do I get it. I already did that in the schema - once and for all.
I have yet to move my early experiments of xPDO to my site. I'll see if I can find a couple of articles and get them up there.
The official docs are good - once you have an idea of what you are doing.
Maybe I need to build a beginners guide on my site.
[ed. note: wshawn last edited this post 12 years, 7 months ago.]