Sorry for the late response... I have been mired in a computer and data disaster the last several days?!
mpb001;10922890 wrote:At the same time, you have to a general direction, framework, orientation and approach in order to tackle anything.
Frameworks in PHP usually don't have to be that big or complicated.
You took "framework" in an IT sense - I just mean it in a general sense.
Normally they just start off following a front/page controller pattern that forces a single point of entry and then knows what object/workflow to initiate by a value in a $_GET.
Can you give me a more detail example of this?
With your lists you were generating with things such as the tax thing you were showing you had the right idea because you are thinking in small components( not god objects ) versus convuluted chains of battling actions.
Good, so it looks like I am on track?!
Yep it is hard. The trick is keep the classes as small as possible. The bigger they are the more tangled they can be and harder to fix when they go wrong.
So, it sounds like you are of the school that Classes should be fairly "atomic" in nature and that you just keep plugging them into each other - like a Lego set - to build larger and larger things?
As far as "god objects", does that mean that you should get to abstract in modeling your site? For instance, maybe you have...
User (parent)
Vistor (child)
Customer (child)
but you avoid things like...
Human (grandparent)
Animal (great-grandparent)
Living Creator (great-great-grandparent)??
We'll go onto self imposed code metrics in a minute. No code is perfect and you'll just have to get used to being imperfect. Make yourself a t-shirt that shouts "REFACTOR MERCILESSLY" and wear it at all times you write code. Eg. Whenever you see those arrows start (http://www.codinghorror.com/blog/archives/000486.html ) time to refactor.
Yah, I'm all for constantly improving things. (It is one thing to remove the wood clapboards and replace them with vinyl siding. But my original fear is wanting/needing to move the driveway after the concrete has dried?! Demolition is not my thing!!)
Thanks for the link!
Needed Google for that 🙂
All the "cool" boys and girls hang out over at www.dictionary.com every day! 🙂
Yep I agree on the PHP front, but that is only really to do with that PHP does not enforce it. In pure OOP languages due to it is forced a lot of people probably just hum along with the band actually never really asking why is it like this.
I say be a rebel and always question authority!! :evilgrin:
In PHP due there has to be a conscious mind shift and it has to be more actively learnt, and also causes all these discussions which I think is good.
Yah, I love getting philosphical about code and life!
The fact you recognise it is a plus in itself.
Thanks!!
Normally in an organised team there are common metrics imposed, say 90% of the time those metrics are always valid. Even though you are not working in a team you impose some metrics on yourself because after they are set you have a very easy warning sign that things are getting a bit out of control.
Okay.
Say
300 lines is a very large class
30 lines is a very large method
10 properties is a lot of properties
20 methods is a lot of methods
2 levels of cyclomatic complexity per method( though if you are proponent of single return that would probably be 3. I was single return now I see it as a waste of a level of indentation. Flat code is prettier. )
Whenever you start hitting that level just ask a conscious question what might you doing wrong. Say 10% of classes may break these rules but they are allowed to if they have a good reason.
That seems like a good way to approach coding Classes. (And those little "rules-of-thumb" are what i am looking for. Life is easier when it is a "science" and not an "art"!)
At the PHP Con this year Aral Balkan did a talk a and in it he was saying about a job where he went in as a consultant somewhere and he was faced with a developer in the state of analysis paralysis on where to start. His recommendation was just build something, and even though I didn't agree with him as it could be misinterpreted to "Just go into Notepad and build something that will make someone else cry for the rest of their life my army of flying monkeys", I think in some rare cases it is a worthwhile professional notion. He was an excellant speaker though and I have a heavy respect for people who can do it that well.
Public speaking is EASY - learning OOP is tricky! 😛
I think your project management head is having a fight with your developer head and causing analysis paralysis.
So my PMP certification is working against me, huh?! 🙂
You need to write something/anything then ask for critique.
This is true.
Well, once I get my new computer working - HDD crashed on a few day old PC - and then get my data off my old, dying PC, and get everything backed up, then I'm off to finish reading my OOP PHP book and maybe one more, then it is time to get down to coding (after I write my requirements and Use-Cases)!!
Do whatever works best for you. When I worked in the media industry I just let the designers battle it out with the clients, go to some of the meetings and then get a wall of A3 printouts and their JPEG forms for measurments/clour stuff. Then I would isolate everything into relational data by seeing what links to what, what is shared between each page and do it component by component. If I saw a flaw or I had a question I would ask the client for confirmation or advise them against it.
You think like I do. I always approach system design from a data standpoint, first. (It's the database person in me!)
Never any official use case stuff but as clients are quite often visually minded they had unwittedley created and agreed. Just by going can we have the banaba link to the monkey etc.
Well, for me, I am a BIG Use-Case advocate.
Personally I would use wireframes for this then make the use cases from the wire frames.
Eg. http://dub.washington.edu:2007/denim/
It will help solidify what you want plus it might be fun to get a bit less formalised and more creative. Whatever the beret wearing frillies( designers ) say softwware development is a creative process.
Well, I will look into that and I do plan on doing lots of "mock-ups" which is closer to your Agile world.
Thanks for all of the links.
Yah, having a tool where I can do ERD's would be great. (One reason I got so hooked on MS Access in years past!)
While my computers died this weekend and my hands were tied, I did lots of Googling on open-source software. (Found a plethora of things I will share down the road for anyone who cares!!)
One open-source project that seemed apropos was this UML CASE tool:
Argo UML (http://argouml.tigris.org)
I am not sure if it has ERD capabilities in it, but it looks sweet for OOP stuff! 🙂
whew
Okay, THANKS for the awesome response!!
Amy