My 2¢

2.
I have used this in similar situations:
$engine = 'Google'; // obviously not hard-coded in a real app.
$this->Controller->$engine->search();

4.
From what I have learned, you should put "anything that is not a
Controller, Model or View" in vendor. So, feel free to put your own
libraries there.

5.
I think I would. They will be easier to find when grouped in a
folder.

/Martin


On Apr 10, 1:54 am, the_woodsman <[EMAIL PROTECTED]> wrote:
> Interesting stuff -
>
> I think you seem to be implying the need for certain design patterns,
> and Stephen is on the money with the Factory (http://en.wikipedia.org/
> wiki/Factory_method_pattern) , or perhaps the Strategy pattern (http://
> en.wikipedia.org/wiki/Strategy_pattern) - but again, this might be
> complete overkill for your requirements!
>
> I can only suggest you look into similar patterns to best decide on
> your approach.
>
> On Apr 9, 9:22 pm, Stephen Orr <[EMAIL PROTECTED]> wrote:
>
> > I can't answer all your points, but in theory, you could probably
> > achieve what you're aiming for in (2) by making SearchEngine a factory
> > class which instantiates the other classes on demand. But you'd
> > probably do better with a different architecture.
>
> > My suggestion would be to use a call such as $this->SearchEngine-
>
> > >search('google', 'keywords');
>
> > Oh, and I'd be more inclined to make SearchEngine a component than a
> > model. Just a difference in opinion, but I think it'd make for simpler
> > usage.
>
> > On Apr 9, 5:08 pm, "R. Rajesh Jeba Anbiah"
>
> > <[EMAIL PROTECTED]> wrote:
> > > (The topic not related to the current 
> > > threadhttp://groups.google.com/group/cake-php/browse_frm/thread/0133dc7f2df...
> > > ; it's different)
>
> > > I'm interested to know the preferred way of organizing the models and
> > > vendor files, for the project say "meta search engine - using
> > > webservices of the search engines":
> > > My idea as of now:
> > > 1. class SearchEngine extends AppModel{
>
> > >     // <some common grabber codes>
>
> > > }
>
> > > 2. class Google extends SearchEngine{
> > >       function search(){
> > >       }
>
> > > }
>
> > > 3. class Yahoo extends SearchEngine{
> > >       function search(){
> > >       }
>
> > > }
>
> > > 4. nusoap in vendor folders
>
> > > 5. Written grabber codes in models folder
>
> > > Question:
> > > 1. Is it the correct approach?
>
> > > 2. I think, it's better that if we can call methods like 
> > > $this->Controller->SearchEngine->Google->search();
>
> > > but with current architecture, it's possible only this:
> > > $this->Controller->Google->search();
>
> > > 3. Is it ok to place *our* grabber codings in models folder?
>
> > > 4. Is it right to say that only the 3rd party scripts to be placed in
> > > vendors folder?
>
> > > 5. Should the sub-model files (Google, Yahoo) to be placed inside a
> > > folder?
>
> > > --
> > >   <?php echo 'Just another PHP saint'; ?>
> > > Email: rrjanbiah-at-Y!com    Blog:http://rajeshanbiah.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to