I can see your argument but I do not think it applies to me. You must
realize my current project it simply a dummy project to learn the
CakePHP framework better and to define for myself a set of good
practices and methods for future projects when I might be working for
a client. Whether I ever run/deploy this project is not a priority to
me. It is my nature to question everything. I will not fall into a
habit of using a certain practice unless I am sure it is the most
optimal practice there is for the given type of problem. I have now
found (or created rather) a more optimal solution for my problem, and
I will use it until I am enlightened by a better one.
On Oct 28, 8:29 am, LunarDraco <[EMAIL PROTECTED]> wrote:
> Because solving it now, is solving a problem that doesn't yet exist.
> If you can not run/deploy your app then that is the first problem you
> need to resolve.
> And between now and the time you figure out the problem to run/deploy
> your app this startup issue may never be the problem.
> So solving it now is going to delay you getting a functional app.
>
> On Oct 27, 4:41 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > No, it does not work for components that take use of startup()
> > shutdown() or initialize()
>
> > Sure, there will be worse bottlenecks, but why not solve this one now
> > instead of later?
>
> > I have created a ComponentLoaderComponent that will do my bidding for
> > the meantime.
>
> > I am assuming cake has no built in commands to load components on run-
> > time then. I have created a ticket for this.
>
> > Thanks for your help (*not being sarcastic)
>
> > On Oct 27, 3:10 pm, teknoid <[EMAIL PROTECTED]> wrote:
>
> > > Have you tried to use it? Does it work? Does it do what you need?
>
> > > ... as far as best practices go, it's best to build something and then
> > > worry about optimization.
>
> > > I assure you that you'll run into a lot more interesting and demanding
> > > issues before you get to the point where the bottleneck of your
> > > application will depend on when/where your Email component is
> > > instantiated.
>
> > > On Oct 27, 5:52 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > Erm... yes that will work, kind of, but then initialize(), startup()
> > > > and shutdown() will not be called in the component (at least I don't
> > > > see how they could... am I wrong?).
>
> > > > I did not do any speed tests, but I would not like components to be
> > > > instantiated unless needed (for instance what if the email component
> > > > had a very heavy startup() method? I am trying to develop good
> > > > practices).
>
> > > > My code seems more logical this way. Here is a pseudocode code
> > > > example
>
> > > > register action:
> > > > --if registration data validates {
> > > > ----save user
> > > > ----load email component
> > > > ----send email to confirm given email address
> > > > --}
>
> > > > This way the email component is not loaded until the app is 100% sure
> > > > it will even be sure.
>
> > > > ...unless maybe cake will handle this potential speed problem for me
> > > > in some way I can not imagine? I am in doubt but anyone is free to
> > > > inform me.
>
> > > > On Oct 27, 2:35 pm, teknoid <[EMAIL PROTECTED]> wrote:
>
> > > > > Well, it does... but did you remember to:
> > > > > $email = new EmailComponent; ?
>
> > > > > p.s. what "speed reasons" did you run into?
>
> > > > > On Oct 27, 5:21 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > > > I've come across a need to load a component via the action for speed
> > > > > > reasons.
>
> > > > > > My case:
> > > > > > I have a user controller with view(), login(), and register()
> > > > > > actions. I need the email component in, and only in, the register()
> > > > > > action. So using var $components = array(etc); is not something I
> > > > > > want to do for speed reasons. I do not want the component loaded
> > > > > > for
> > > > > > actions that do not use it.
>
> > > > > > Looking at the docs it looks like this should work:
> > > > > > App::import('Component', 'Email');
>
> > > > > > But it doesn't. (??)
>
> > > > > > So how can this be done?
>
> > > > > > Thanks,
> > > > > > Jonah
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---