Am I approaching my symfony project correctly?
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 advanceEdit Can someone please touch on adding fields to doctrine & migrations? Are migrations always necessary? If I'm not alter开发者_JAVA技巧ing 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.
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).
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.
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.
精彩评论