SitePoint Sponsor

User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 25 of 86

Thread: UML, PhP 5, MVC

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2004
    Location
    Fort Lauderdale
    Posts
    522
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    UML, PhP 5, MVC

    I am creating an "on line personal training" application in PhP5. I am currently looking into UML and drawing up use cases, activity diagrams, classes, sequence diagrams and component diagrams.

    I have never used UML before and object oriented development is somewhat new to me from the php 5 perspective. ( coded in Java before ).

    I would like to use Smarty as the template engine.

    I haven't decided which php patterns I should use, but I know for sure I would like to focus on MVC ( Model View Controler ) and separate my objects into components.

    I wanted to get an opinion about how effective UML design will be in developing an application in PHP 5.

    I am not aware of any forward engineering tools for php currently, so I know that my classes will not be able to be generated by "Poseidon Community Edition" for example.

    I am also using the GRAPPLE approach to application development. Please give me some suggestions and feedback on how I should effectively spend my time to prepare for the coding..

    Thanks

  2. #2
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by photo312
    I am also using the GRAPPLE approach to application development. Please give me some suggestions and feedback on how I should effectively spend my time to prepare for the coding..

    Thanks
    Personally I think you are wasting a lot of time drawing up lots and lots of diagrammes. Break your project down, do some rough planning and start coding as soon as possible. Test, code, refactor. Don't decide from the beginning that you are going to use x, y and z pattern. Start writing code and some appropriate patterns should reveal themselves to you. If you have decided you want to take an MVC approach thats fine, but don't get too hung up about it at this stage.

  3. #3
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by photo312
    I would like to use Smarty as the template engine.
    Don't.

  4. #4
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    Actually, that argument is hardly convincing, especially if you have untrusted templates or want to provide your users with cleaner syntax, named parameters and other niceties. The reason that every framework worth its salt either incorporates a template engine or integrates with one is that PHP is not such a hot template language all on its own -- despite its history.

  5. #5
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    The reason that every framework worth its salt either incorporates a template engine or integrates with one is that PHP is not such a hot template language all on its own -- despite its history.
    Actually, many of those template engines are based on PHP, just like the one in the linked article. I especially eschew Smarty, as nearly all of its features are already available in PHP, so that it seems silly to use an interpreted templating language based on another interpreted templated language.

  6. #6
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    Actually, many of those template engines are based on PHP, just like the one in the linked article. I especially eschew Smarty, as nearly all of its features are already available in PHP, so that it seems silly to use an interpreted templating language based on another interpreted templated language.
    Hi. Yes, and many others are not. In fact, show me one decent template engine that is pure PHP (other than PHP itself). There isn't any -- they are just conventions and framework around PHP as a template language. If, as 33degrees suggests, Smarty has too much power then surely that must imply that PHP is even more unsuitable to the task. At least Smarty provides a means to control the features exposed in the template while at the same time presents thoughtful tools for developers and a clear syntax for designers. I understand that a certain group of people don't favour Smarty but I for one find articles like Brian's really miss the point of using a system like Smarty.

    BTW: Smarty is not interpreted -- it compiles to PHP.

  7. #7
    SitePoint Guru 33degrees's Avatar
    Join Date
    May 2005
    Posts
    707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    If, as 33degrees suggests, Smarty has too much power then surely that must imply that PHP is even more unsuitable to the task.
    PHP is definitely a poor templating language, because it does absolutely nothing to seperate presentation from business logic. The difference is that PHP is the native language, if I'm going to bother using a second, templating language, then I want that language to enforce the seperation; if the templating language is basically php with a different syntax, why bother?

  8. #8
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If UML is new to you, I don't think it will add any value, but simply be overhead for you. The power of UML is in communication - you could say that it's a formal language for describing software amongst professionals. If you don't know UML, and you're not going to work with somebody who do, the language will just be a hindrance. Compare it to two people trying to communicate in a language in which none of them are profecient.

  9. #9
    SitePoint Guru 33degrees's Avatar
    Join Date
    May 2005
    Posts
    707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IMO, template languages are useful, but smarty gives you way too much power.

  10. #10
    SitePoint Evangelist
    Join Date
    Mar 2004
    Location
    Fort Lauderdale
    Posts
    522
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have used Smarty Extensively and I like it. I also must disagree with some of the UML critics. Good programming comes out from good preparation and from a "Bird view" of the classes and their connections. How am I supposed to learn the "Decorator Pattern" or the "Factory Pattern" unless I see its interaction with classes from this "Bird View" analogy.

    I am going to be posting my questions relating to the class design next. I am indeed dissapointed by the UML critics. I trully am.

  11. #11
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by photo312
    I have used Smarty Extensively and I like it. I also must disagree with some of the UML critics. Good programming comes out from good preparation and from a "Bird view" of the classes and their connections. How am I supposed to learn the "Decorator Pattern" or the "Factory Pattern" unless I see its interaction with classes from this "Bird View" analogy.

    I am going to be posting my questions relating to the class design next. I am indeed dissapointed by the UML critics. I trully am.
    But what has learning patterns got to do with planning a project? UML makes good documentation. I don't think its especially useful for planning except for perhaps making a few sketches to make things clearer.

    People here aren't neccesarily UML critics, but I think you'll find a lot of people here prefer the TDD route over Big Up-front Design.

  12. #12
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But what has learning patterns got to do with planning a project? UML makes good documentation. I don't think its especially useful for planning except for perhaps making a few sketches to make things clearer.

    I think you'll find a lot of people here prefer the TDD/only as much planning as needed route over Big Up-front Design.
    Documentation matters. Planning matters. For good projects they also tend to go hand-in-hand. Perhaps instead of "a lot of people" you mean a few busy posters? it should also be noted that several case tools and code generators make good use of UML.

    Maybe it is just me but something I noticed about sitepoint is that if something isn't used, appreciated or understood by a vocal minority, it gets shouted down and dismissed very quickly and without any thoughtful reflection. It is as if a few folks have deigned the perfect way of coding and are incapable of tolerating any mention of any other method. Yes, PHP has many newbies behind it but it seems inappropriate when it is assumed that everyone is a newbie just because they don't do things the way that the 'popular' kids do it. Or maybe I'm just in need of coffee

  13. #13
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    Documentation matters. Planning matters. For good projects they also tend to go hand-in-hand. Perhaps instead of "a lot of people" you mean a few busy posters? it should also be noted that several case tools and code generators make good use of UML.
    You'll note I did not say "do not plan" or "do not document". Document where needed, do as much planning as neccesary, but the important thing is to start writing code. If you make a big up front plan then find things have changed half way through you would have wasted a lot of time.

  14. #14
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by jayboots
    Maybe it is just me but something I noticed about sitepoint is that if something isn't used, appreciated or understood by a vocal minority, it gets shouted down and dismissed very quickly and without any thoughtful reflection.
    Then you haven't been paying attention. This forum tends very much to the opposite, that's one of the reasons I like it. Lot's of new ideas, even mad ideas, have had a chance to take flight here.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  15. #15
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by photo312
    I am creating an "on line personal training" application in PhP5. I am currently looking into UML and drawing up use cases, activity diagrams, classes, sequence diagrams and component diagrams.
    If your currently looking into it i have to say there's more to UML than a quick lookin but if that's what serves your needs then go for it, tried Microsoft Visio yet, awesome tool for UML and lot's of available training video's from Lydia's to get around it quick if you plan on investing....

    Quote Originally Posted by photo312
    I have never used UML before and object oriented development is somewhat new to me from the php 5 perspective. ( coded in Java before ).
    Why would you even use PHP then ?

    Quote Originally Posted by photo312
    I would like to use Smarty as the template engine.
    I'm not a big fan of templating systems but if you go for smartyt and are looking for a high-end system i would reccomend looking into Mojavi 3 http://www.mojavi.org/ which has a view setup for Smarty.

    Quote Originally Posted by photo312
    I haven't decided which php patterns I should use, but I know for sure I would like to focus on MVC ( Model View Controler ) and separate my objects into components.
    Whenever doing this concider that with one pattern comes another one, remember that a pattern has to create the context for another pattern otherwise it would not be functional to you in terms of re-use and maintanance.

    Quote Originally Posted by photo312
    I wanted to get an opinion about how effective UML design will be in developing an application in PHP 5.
    Just as effective as you would use it for Java, remember that URL is merly a tool to keep track of the Big-Picture and Small-Details at the same location.

    Quote Originally Posted by photo312
    I am not aware of any forward engineering tools for php currently, so I know that my classes will not be able to be generated by "Poseidon Community Edition" for example.
    Depends on what you mean with "forward engeneering"

    Quote Originally Posted by photo312
    I am also using the GRAPPLE approach to application development. Please give me some suggestions and feedback on how I should effectively spend my time to prepare for the coding..
    Grapple, hmmm reminds me of Quake2 CFT, man what a time...
    I'm not sure what you mean with "grapple approach" but i figure out it has to be something like a plugin-like method then keep in mind that a plug in is something that "could" adjust itself to fit the right shape if the context of that plugin is flexible enough, in other words, do all patterns u use in your app line up and make the circle round.

    With patterns the thing is, you can find a pattern for everything, but as long as your problems are not clear the patterns can never solve them.

    Hope this help a bit....

    Galo
    Business as usual is off the menu folks, ...

  16. #16
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rendering is geting a native input and having a datailed output
    Or an ouput of varied formats or content based on the input; Templating to me, just means that you are allowed the means to present your data more easily, again this may appear to be like rendering, but it isn't...

    You may just have the one template, but a variable number of renderers that use the one template, but only differently

  17. #17
    SitePoint Evangelist
    Join Date
    Mar 2005
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey, i loved these quotes:

    Quote Originally Posted by Galo
    do all patterns u use in your app line up and make the circle round
    Quote Originally Posted by Galo
    With patterns the thing is, you can find a pattern for everything, but as long as your problems are not clear the patterns can never solve them.
    Nice theoretical statements there, to keep oneself grounded. Thanks

  18. #18
    SitePoint Evangelist
    Join Date
    Mar 2004
    Location
    Fort Lauderdale
    Posts
    522
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do have the book " Head first design patterns" and I like it. I am going to take a look at the PhP5 power programming and see how things are done there.

    I have looked into the PhP-Architect Patterns book, which I got for christmass and it was very bad - They explain patterns by using a PHPUnit class for testing. Its very convoluted.

    As far as templating - I will stick to smarty. I have experience with it and, I will ad more DDR2 Ram to my box and that should take care of the extra processing that Smarty requires. Or I will get a faster Chip.

  19. #19
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by photo312
    I have looked into the PhP-Architect Patterns book, which I got for christmass and it was very bad - They explain patterns by using a PHPUnit class for testing. Its very convoluted.
    Not "they" ... I . Perhaps following up on Luke's recomended link, and in particular the XP practice of Test Driven Development would be worth your while.

    Quote Originally Posted by Luke Redpath
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  20. #20
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The second post by kyberfabrikken hit the nail on the head.

  21. #21
    SitePoint Evangelist
    Join Date
    Mar 2004
    Location
    Fort Lauderdale
    Posts
    522
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The waterfall analogy - it is old and no longer works and I agree with you - it is too strict and future changes in business logid are not easily implemented.

    but:

    I started this thread mentioning the concept: "GRAPPLE" a system that involves sequence, activity diagrams along with building classes. This is a very flexible strategy that involves everything mentioned in this thread but in an organized manner.

    Yes - diagrams are a must, use cases are a must. I thought that people on here would know what Grapple is - if not please look it up on Google.

  22. #22
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by photo312
    I started this thread mentioning the concept: "GRAPPLE" a system that involves sequence, activity diagrams along with building classes. This is a very flexible strategy that involves everything mentioned in this thread but in an organized manner.

    Yes - diagrams are a must, use cases are a must. I thought that people on here would know what Grapple is - if not please look it up on Google.

    Hmmm. Google says:

    Grapple :: Adam Kalsey
    I just tried a Grapple, an apple that is supposed to taste like a grape. ...
    Id rather my child eat a grapple for a snack versus some of the other choices ...

    And I scanned throught the top 50 results and not one of them had to do with software development . I think I just learned never to name a project after an obscure fruit or to choose an acronym that is actually a common word.
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  23. #23
    SitePoint Guru 33degrees's Avatar
    Join Date
    May 2005
    Posts
    707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No mention of GRAPPLE on c2.com nor on wikipedia, maybe you could try finding us a link?

  24. #24
    SitePoint Evangelist
    Join Date
    Mar 2004
    Location
    Fort Lauderdale
    Posts
    522
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do a google search for "GRAPPLE, uml" and you will see.

  25. #25
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    All I found was a reference to an old Sams book (with a broken link) and an obscure scientific paper. You need to do a bit more here than just "Google". Perhaps you could describe GRAPPLE as you understand it.

    In the obscure paper I found "Guidelines for Rapid Application Engineering" seems to be the acronym and it also seems to have been written around UML specifically. That's a bit tail wags dog, as even RUP doesn't mandate UML (although it's hard to avoid). GRAPPLE also has three steps before any requirements are gathered, and nine before the design phase. Academic papers on methodology are always a bit of a disaster, but this is waterfall gone mad . I really hope it's been misrepresented.

    Regarding use cases, no one is saying don't collect use cases. Quite the opposite, you want to maximise the benefit from them. Agile approaches merely start coding as the use cases come is, so as to give early feedback. Showing the customer and users the software always has a dramatic effect on requirements. It's better that this impact comes early.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •