Re: newbie WO/EOF questions
Re: newbie WO/EOF questions
- Subject: Re: newbie WO/EOF questions
- From: Ken Anderson <email@hidden>
- Date: Sun, 02 Oct 2005 15:22:18 -0400
Boris,
First off, I personally think you're making a very good choice in
WebObjects - it's a fantastic technology. I understand the situation
you're in, and it's one that many people find themselves in when
trying to 'grok' WO.
Have you done any programming in Java or another OO language? That
will be helpful. The best way to approach this is in 2 stages:
1) What arrangement of objects would best suit my access to my data?
2) How can I get the database I have into that object model?
Since you're working with an existing database, you sometimes have to
make compromises between these two questions (starting fresh, you can
go the 100% object model way).
If the database is highly normalized, you'll have an easier time
going from one to the other, but in any case, the exercise is well
worth the effort.
An important recommendation I have is to ignore performance the first
time through. When you're used to accessing databases directly and
combining columns from multiple tables in your result set, you might
start worrying too early in the process whether the multiple levels
you're ending up with will perform poorly. Rest assured, when you
have a well structured model working that properly models your
business objects, there are many things you can do with EOF to
improve performance. Remember, make it work, make it work well, make
it work fast!
Does your database have situations where there are types that are
very similar to each other? If you do, inheritance is a likely
route, but I suggest you present the related tables to people on the
list so they can comment on the best approach. Inheritance is
probably the best and worst feature of EOF at the same time. Used
well, it's a huge advantage - used poorly, and you'll curse it
forever. At WWDC, the guys who wrote the iTunes Music Store said
they had over 400 entities (objects) in their model, but (I believe),
only 2 inheritance hierarchies. I may have that number wrong, but
you get the idea... frugality!
I suggest you model a small portion of your database first and then
write a small app to exercise that model. This will help you
understand the pros and cons of different styles without going too
far down one path.
Lastly, all I can say is dive in! It's a lot easier to get
assistance on the list if you have a concrete problem rather than a
fuzzy concept.
Good luck!
Ken
On Oct 2, 2005, at 2:58 PM, Boris Herman wrote:
Hello list,
I've been programming database applications for quite a while now.
First with flat files and manual indexes in the 80's, then with
local databases with concurrent lockings over to RDBMS and SQL.
I've been using several RAD tools in several programming languages
so the choices are plenty.
A client of ours wants to port (i.e. write anew) their business
system which now runs as a win/mac client connected to a SQL
server. They want to have it as an intranet application that runs
in a browser window. Since I've been writing my own SQL statements
for well over a decade the choice would be something like PHP but
I've been looking at WebObjects as it is more advanced, needs less
maintanence and vital components (such as SQL server) to a system
can be changed without major changes in program. I really like the
"upside-down" mechanism (frameworks) and the fact that most things
that have to be done manually in PHP are done completely automatic.
I know that WO is application server and PHP is just a scripting
language but I'm talking solutions here, not technologies. Also a
big plus is that the client already has 10.4 server up and running
(which includes deployment license for WO) and I'm doing most of
the work on my Macs anyway.
The trouble I'm facing (and I'm probably not the only one) is that
the EOF needs a totally different way of thinking which is
incompatible to my previous experience. I'm worried that during the
development I will subconciously revert to old style programming
and not the "WebObjects way". The moto I've read "if you are
writing code, you are doing something wrong" haunts me and reminds
me over and over that I really need to learn something new really
well.
I've purchased and digested several books on the topic, including
two that I've seen most recommended: Webobjects for Mac OS X by
Joshua Marker (which doesn't go deep enough for my taste) and
Practical WebObjects (which will most certainly become a priceless
resource AFTER I've become a full grown WebObjects developer). I've
also gone thru most of the tutorials and walktroughs available on
the net.
But I still don't know my ways around EOF, in particular to
relationships, be it to-one or to-many. I've grown so accustomed to
writing SQL queries (thinking SQL) and making relationships (or
iterating thru) with SELECTs I'm having a hard time grasping the
new concept. Until now I SELECTed any relationships either inner or
outer joins and used the foreign columns as they were columns in
the source table (hence the join). Now in WebObjects, I have whole
records (in to-one) and NSArrays of whole records (in to-many) as
the result of a relationship. Things get even more hairy when I
have relationships several levels deep and mixed to-one and to-many.
Where would a database app developer like me get proper guidance to
start seriously on WebObjects on a semi-large project? The client
database has about 20 tables, the main ones have over 2 mio
records, each full of metadata of different types and 5 foreign
keys. There is also a text field, which is occasionally searched
via fulltext index and relevance scoring.
Thanks for any input and suggestions,
Boris Herman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden