Naming conventions for Module, ActionController und view-scripts.phtml

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Naming conventions for Module, ActionController und view-scripts.phtml

Ralf Eggert
Hi,

I am currently working on ZFTool and there is a little discussion going
on about naming conventions for Module and ActionController classes and
view-scripts.phtml.

https://github.com/zendframework/ZFTool/pull/78/files#r8288599

I always thought these are the "rules"

- Modules should be camel-cased with an initial capital letter:
  -> /module/Shop
  -> /module/NiceBlog

- Controllers should be camel-cased with an initial capital letter
  and end with the Controller suffix:
  -> /module/src/Shop/Controller/ShopController
  -> /module/src/NiceBlog/Controller/NiceBlogController

- Besides view scripts should be all lowercase and dashed:
  -> /module/Shop/view/shop/shop/create.phtml
  -> /module/Shop/view/nice-blog/nice-blog/create-blog.phtml

If I understand Marco correctly, he says these conventions should not be
enforced by ZFTool.

I think that ZFTool is a tool for beginners to make there first steps
with the ZF2. These guys are almost always very impressed by the
complexity of ZF2 and they are very grateful for some conventions to
match to get them started.

What do others think? Should ZFTool enforce these conventions or should
ZFTool let people do whatever they want?

Thanks and best regards,

Ralf

Reply | Threaded
Open this post in threaded view
|

Re: Naming conventions for Module, ActionController und view-scripts.phtml

dolphin
This post has NOT been accepted by the mailing list yet.
Meiner meinung nach:
In order to set parameters such command line is not good. Your task is complicated by the fact that can be used phar archive.
It is obvious that to create complex configurations need a configuration file. Different operating systems, this file configuration may be stored in various places. Search in these places and merge configurations must occur sequentially. Last place - in the same directory as the ZfTool.
Reply | Threaded
Open this post in threaded view
|

Re: Naming conventions for Module, ActionController und view-scripts.phtml

Spabby
In reply to this post by Ralf Eggert
It's a best practice but shouldn't be enforced by the tool.

Just my opinion of course :)

G


On Fri, Dec 13, 2013 at 6:02 AM, Ralf Eggert <[hidden email]> wrote:
Hi,

I am currently working on ZFTool and there is a little discussion going
on about naming conventions for Module and ActionController classes and
view-scripts.phtml.

https://github.com/zendframework/ZFTool/pull/78/files#r8288599

I always thought these are the "rules"

- Modules should be camel-cased with an initial capital letter:
  -> /module/Shop
  -> /module/NiceBlog

- Controllers should be camel-cased with an initial capital letter
  and end with the Controller suffix:
  -> /module/src/Shop/Controller/ShopController
  -> /module/src/NiceBlog/Controller/NiceBlogController

- Besides view scripts should be all lowercase and dashed:
  -> /module/Shop/view/shop/shop/create.phtml
  -> /module/Shop/view/nice-blog/nice-blog/create-blog.phtml

If I understand Marco correctly, he says these conventions should not be
enforced by ZFTool.

I think that ZFTool is a tool for beginners to make there first steps
with the ZF2. These guys are almost always very impressed by the
complexity of ZF2 and they are very grateful for some conventions to
match to get them started.

What do others think? Should ZFTool enforce these conventions or should
ZFTool let people do whatever they want?

Thanks and best regards,

Ralf


Reply | Threaded
Open this post in threaded view
|

Re: Naming conventions for Module, ActionController und view-scripts.phtml

Antoine Michael
Yes it's a good idea for newbe's guys, but the tool shouldn't force user to use this best practice..

the tool should give the choice to user to use his naming convention, ZF2 is not SF2 !

as Gary, it's just my opinion ;-)

Regards,

Michael A.

 
Le 13/12/2013 10:23, Gary Hockin a écrit :
It's a best practice but shouldn't be enforced by the tool.

Just my opinion of course :)

G


On Fri, Dec 13, 2013 at 6:02 AM, Ralf Eggert <[hidden email]> wrote:
Hi,

I am currently working on ZFTool and there is a little discussion going
on about naming conventions for Module and ActionController classes and
view-scripts.phtml.

https://github.com/zendframework/ZFTool/pull/78/files#r8288599

I always thought these are the "rules"

- Modules should be camel-cased with an initial capital letter:
  -> /module/Shop
  -> /module/NiceBlog

- Controllers should be camel-cased with an initial capital letter
  and end with the Controller suffix:
  -> /module/src/Shop/Controller/ShopController
  -> /module/src/NiceBlog/Controller/NiceBlogController

- Besides view scripts should be all lowercase and dashed:
  -> /module/Shop/view/shop/shop/create.phtml
  -> /module/Shop/view/nice-blog/nice-blog/create-blog.phtml

If I understand Marco correctly, he says these conventions should not be
enforced by ZFTool.

I think that ZFTool is a tool for beginners to make there first steps
with the ZF2. These guys are almost always very impressed by the
complexity of ZF2 and they are very grateful for some conventions to
match to get them started.

What do others think? Should ZFTool enforce these conventions or should
ZFTool let people do whatever they want?

Thanks and best regards,

Ralf



-- 
Michael Antoine

Ingénieur Etude et Développement
Architecte, Chef de projets
Technologies Open Source

Tél : 0662261659
Reply | Threaded
Open this post in threaded view
|

Re: Naming conventions for Module, ActionController und view-scripts.phtml

dolphin
This post has NOT been accepted by the mailing list yet.
ark built  newbe's guys. Professionals built the Titanic. I do not see any proposals. I guess I did not read carefully :) ?
Reply | Threaded
Open this post in threaded view
|

Re: Naming conventions for Module, ActionController und view-scripts.phtml

Ralf Eggert
In reply to this post by Spabby
Hi Gary,

> It's a best practice but shouldn't be enforced by the tool.

Is it really just the best practice or are these naming conventions just
only following the ZF2 coding standards. So why should we bother about
coding standards at all?

Anyway, maybe we could a flag which is following the coding standards by
default and can be set if some one does not want to. This would help
beginners to start and let the pros do whatver they want.

Any thoughts?

Thanks and best regards,

Ralf
Reply | Threaded
Open this post in threaded view
|

Re: Naming conventions for Module, ActionController und view-scripts.phtml

Ralf Eggert
In reply to this post by Spabby
Hi again,

I wonder what freedom would you want when it comes to naming modules?

Should all this module names be able to be created:
- Event
- event
- MyEvent
- MyEvEnT
- my-event (does not make sense, does it?)

Same goes for controllers:
- EventController
- eventController
- MyEventController
- MyEvEnTController
- my-eventController (does not make sense, does it?)

So, dashed parts should be filtered to camel case all the time, right?

Thoughts?

Thanks and best regards,

Ralf
Reply | Threaded
Open this post in threaded view
|

Re: Naming conventions for Module, ActionController und view-scripts.phtml

dolphin
This post has NOT been accepted by the mailing list yet.
Basically, I fully agree that it is enough to abide by agreements zf2 . It seems to me there are several reasons :
1) What will be more flexible module , the greater the need to write code. It's obvious. There must be some reasonable limit .
2 ) The tool is called ZfToolt. If someone needs - can extends it . Fortunately, the zf2 architecture allows do it very easily .
3) You are very accurately observed, the main task of the tool - fast start . This is not an architectural complex . But it's really convenient to introduce 2-3 team instead of a number of different actions to perform manually.
4) I still think that we should not watch what others are doing . Zf2 different from any other framework that, in matters of creating good project can easily go the academically right way. I mean Zend Studio and Eclipse PDT.