我是否正确地处理我的 symfony 项目?
几个月来我已经回来了。阐述我的开发方法 我工作所需的一个项目最终会让我赚很多钱 由于销售效率的提高。我一直在尝试构建一个 php CRM 一旦我构建了一些产品,我就需要将其用于客户管理 它的基本功能,这样我就可以摆脱在记事本++中存储笔记的麻烦 在多个选项卡中(非常难看,但我正在兑现支票和按扣领)。
我深入研究了 CodeIgniter &开发接口时遇到了头疼的问题 jQuery ui 选项卡后来决定(这是 2.0 之前的事情)我应该转移到另一个框架,现在我开始研究 Symfony。
我的第一个问题是,即使我的整个应用程序将位于一个页面上,我是否真的需要 mvc 或 mvc 框架?由像选项卡这样的 jquery 元素组成,无需重新加载页面?
我的第二个问题是,使用 ORM 是否会使事情变得过于复杂?当您编辑架构(原则)时,我不完全理解迁移的需要。需要关于如何解决这个问题的建议,因为这似乎是一个高级编码员可以在一个小时内完成的事情,而我花了几个月的时间进行研究。提前致谢
编辑 有人可以谈谈向学说和规则中添加字段吗?迁移?迁移总是必要的吗?如果我不改变现有的结构&我只是添加新表或可选字段,我是否需要在生产环境中进行更改,或者这是否危险较小?现在,这是阻碍我尝试用 Symfony 编写任何内容的主要因素。
编辑 #2* 坚持 Symfony/原则。我从来没有花时间用 Inkscape 来模拟界面,或者完全绘制出整个数据库模式。几乎准备好开始挖掘了。
For several months now I've been back & forth on my approach to developing
a project that I need for work that will eventually make me a lot of money
due to increased sales efficiency. I've been trying to build a php CRM
that I will need to use for customer management as soon as I build some
basic functionality into it so I can get away from storing notes in notepad++
in multiple tabs (very ugly but I'm cashin checks & snappin necks).
I dove into CodeIgniter & ran into headaches when developing the interface with
jQuery ui tabs then later decided (this was prior to 2.0) that I should move to another framework which now has me diving into Symfony.
My first question is, do I really even need a mvc or mvc framework even if my entire app is going to be on one page & consist of jquery elements like tabs with no page reloading?
My second question is, am I overcomplicationg things by looking at using an ORM? I don't fully understand the need for migrations when you edit your schema (doctine). Need advice on how to approach this as it seems like something an advanced coder could knock out in an hour where as it's taken me severl months in research. Thanks in advance
Edit
Can someone please touch on adding fields to doctrine & migrations? Are migrations always necessary? If I'm not altering existing structure & I'm just adding new tables or optional fields, do I need to jump through hoops to make changes in my production environment or is this less hazardous? Right now this is the main thing that's holding me back from attempting to write anything in Symfony.
Edit #2*
Sticking w/ Symfony/doctrine. I never took the time to mockup the interface w/ Inkscape or put the fully plot out the entire database schema. Almost ready to start digging in.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有点含糊,但我会看看是否可以解决您的一些观点。
我应该担心 MVC 吗?
不,如果您只是快速地将一些东西组合在一起,那么它可能并不那么重要。这种模式更适合较大的项目,并使所有代码和接口等尽可能分开,以便于维护和修复错误。意见会有所不同,但我建议首先获得一些在这种情况下有效的基本知识。
我是否因担心 ORM 而使事情变得过于复杂
是的,可能。这取决于您是否能更快地理解它,而不是正确理解 SQL 或数据库本机使用的任何内容。恐怕我对教义一无所知。
基本的入门建议?
从您可以构建的最简单的东西开始,然后添加一个东西并简化/移动/删除代码,以便更轻松地添加更多东西。重复直到您满意为止。仅考虑较大的更改,例如 MVC 框架,如果您相信它们会让您的生活更轻松(对于这种规模的项目,可能会在以后出现)。
Bit vague, but I'll see if I can address a couple of your points.
Should I worry about MVC?
No, it is probably not that important if you're just throwing something together quickly. This kind of pattern is more geared towards larger projects and making all the code and interface etc. as separate as possible to make maintenance and bug-fixing easier. Opinions will vary, but I suggest getting something basic that works first in this case.
Am I overcomplicating things by worrying about ORM
Yes, probably. It depends on whether you can wrap your brain around it quicker than you can get a proper understanding of SQL or whatever your database uses natively. I don't know anything about doctrine, I'm afraid.
Basic starting advice?
Get started with the simplest thing you can build, then add one thing and simplify/move/remove code to make it easier to add more things. Repeat until you are happy with it. Only consider the bigger changes, like MVC frameworks if you believe they will make your life easier (maybe later down the line for a project this size).
鉴于您“喜欢这个结构”,您至少应该尝试使用它。即使您的页面不需要重新加载,您也可能需要通过 ajax 重新加载数据。 Symfony 与 jQuery 的 ajax 配合起来既简单又直接。
You should at least try to use it, given that you "like the structure". Even if your page doesn't need reloading, you probably need to reload data via ajax. Symfony is easy and straightforward in pairing with jQuery's ajax.
如果它主要是 Javascript 应用程序,您可能不需要像 Symfony 这样的大型框架,但您可以查看 Silex 作为更轻量级的替代方案。它基于一些 Symfony 组件。某种框架对于组织 Ajax 请求处理程序很有用。
然后在客户端,如果可能会变成大型单页 JS 应用程序,您可以使用 Backbone.js 或 JavascriptMVC 之类的东西来组织 JS 代码。
教义迁移
您不需要使用此功能 - 您只需编写一个 SQL 查询即可将所需的表/列添加到数据库中并在生产数据库上执行它。
If it's going to be a primarily Javascript app you might not need a large framework like Symfony, but you could check out Silex as a more lightweight alternative. It is based on some Symfony components. Some kind of framework will be useful for organising the Ajax request handlers.
Then on the client side you can use something like Backbone.js or JavascriptMVC for organising your JS code if it's likely to turn into a large single page JS app.
Doctrine Migrations
You don't need to use this feature - you can simply write an SQL query which adds the tables/columns you need to your database and execute it on your production DB.