stoutie
Programmer
- May 14, 2011
- 4
Any folks out there have a good understanding of OOP, UML, PHP and MVC? Quite a whiz-bang combination. I don't know many people that do. I've come to adopt all of these things as part of the work I do.
I'm planning a web application right now, and taking the opportunity to boil the planning phase down to a science. But I'm stuck. I have a good idea of how I want to start planning, and where I need to end up, but the stuff in the middle is the problem.
I really have never been comfortable with the whimsical way classes and their methods are chosen.
I should fill you in on a few things:
I'm working with a PHP framework that uses components and scripts. Each component consists of a model, view and controller class. The component may also have a templates folder. The controller provides the methods for the application to interact with the component. The method provides the controller with the methods to interact with the data. The view provides the controller with the methods to interact with the templates, presentation, or output formatting. Now the script utilizes the components to satisfy the request. The script to include is determined by the first segment of the request url. The scripts may utilize multiple components.
Now, where I'm starting is with the planning process. I want to boil it down to a science that can be repeated quickly and efficiently. I start with use case diagrams. Then for each use case I develop narratives. Then, I develop use case scenarios using activity diagrams.
At this point, I'm thinking I should have enough information to start defining components, and the methods on their controllers, models and views.
I think it should be a simple matter of looking at the use case scenarios activity diagrams and assigning each activity performed by the application to a method on either the model or view of the appropriate component.
Then the controller would get a method for each use case. But decided that since a use case could involve multiple components, the component should not be responsible for the entire use case. It seemed more appropriate to assign the use case to a script in the scripts folder.
So that's where I'm at. I need a good discussion group to hash out some theories about how to get from the use case scenarios to the scripts, the components they use, and the methods on the components' models, views and controllers.
Maybe a case study would help uncover some of these theories? How about we start with a simple blog?
Use cases:
user can create post
user can view post
user can edit post
user can delete post(s)
user can publish post
user can save post as draft
user can mark posts public/private
I'm planning a web application right now, and taking the opportunity to boil the planning phase down to a science. But I'm stuck. I have a good idea of how I want to start planning, and where I need to end up, but the stuff in the middle is the problem.
I really have never been comfortable with the whimsical way classes and their methods are chosen.
I should fill you in on a few things:
I'm working with a PHP framework that uses components and scripts. Each component consists of a model, view and controller class. The component may also have a templates folder. The controller provides the methods for the application to interact with the component. The method provides the controller with the methods to interact with the data. The view provides the controller with the methods to interact with the templates, presentation, or output formatting. Now the script utilizes the components to satisfy the request. The script to include is determined by the first segment of the request url. The scripts may utilize multiple components.
Now, where I'm starting is with the planning process. I want to boil it down to a science that can be repeated quickly and efficiently. I start with use case diagrams. Then for each use case I develop narratives. Then, I develop use case scenarios using activity diagrams.
At this point, I'm thinking I should have enough information to start defining components, and the methods on their controllers, models and views.
I think it should be a simple matter of looking at the use case scenarios activity diagrams and assigning each activity performed by the application to a method on either the model or view of the appropriate component.
Then the controller would get a method for each use case. But decided that since a use case could involve multiple components, the component should not be responsible for the entire use case. It seemed more appropriate to assign the use case to a script in the scripts folder.
So that's where I'm at. I need a good discussion group to hash out some theories about how to get from the use case scenarios to the scripts, the components they use, and the methods on the components' models, views and controllers.
Maybe a case study would help uncover some of these theories? How about we start with a simple blog?
Use cases:
user can create post
user can view post
user can edit post
user can delete post(s)
user can publish post
user can save post as draft
user can mark posts public/private