473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Mixing Oil and Water ?? (PHP with UML & Unit Testing)

Hello,

I don't program full-time (anymore), but I do try and stay on-top of
the latest technologies and like most are always trying to upgrade my
skills and remain current (as much as is possible).

Most of my programming these days involves using PHP for creating
script files for automating tasks and procedures (locally), and also
for anything that might be needed by our divisional Intranet (not a
huge site by any stretch of the imagination).

Two topics that keep popping up at me are UML and Unit Testing, or
Test Driven Development (TDD).

Due to my current situation my time is somewhat restricted and limited
in scope -- and therefore I try and keep things relevant to what I am
working on, in this case it would be scripting with PHP. Therefore I
have a few questions:

1. Is UML often used when setting up web-sites (Intranet or
Internet), or more specifically web-based applications? If so, is it
applicable to using with PHP (or visa-versa).

From my limited understanding of things -- UML to me seems to be used
mostly for OOP programming and Objects, which doesn't really seem
useful for web-site & applications unless you are creating really
*large* and complex sites -- which of course I am not.

2. Like with UML, is Unit Testing or TDD applicable and appropriate
for PHP scripting or web-application development?

I do a lot of testing of smaller pieces of code (modules) in my
projects, but nothing to the extent or level that seems prevalent
(religious?) with Unit Testing. Again, like UML, Unit Testing seems
to me to work best when using OOP and objects, such as testing each
object separately (methods, properties) before assembling them
together into a project or application. However, if you do not use
objects, does Unit Testing still apply??

3. If any of the above do apply, can anyone suggest to me some
resources (ie: books, web-sites, articles, etc..) that would be
helpful, preferably with using PHP, but not limited too specifically.

I don't know if my questions are too vague, or too general. Basically
I always try and learn new things and these are two that seem to be
either popular, or just spark my interest. I don't mind spending time
learning something even if it is not 100% applicable to my situation
-- on the other hand, if there is something else out that would be
more so I would rather spend the time learning that instead.

Thanks so much.

Hugh
Jul 17 '05 #1
4 3710
Hello,

On 10/27/2003 08:47 PM, Hugh Cowan wrote:
1. Is UML often used when setting up web-sites (Intranet or
Internet), or more specifically web-based applications? If so, is it
applicable to using with PHP (or visa-versa).

From my limited understanding of things -- UML to me seems to be used
mostly for OOP programming and Objects, which doesn't really seem
useful for web-site & applications unless you are creating really
*large* and complex sites -- which of course I am not.
AFAIK, the use of UML or OOP does not have to do the size of the sites.

For instance, any database driven project could have its data model
described with UML artifacts and you can use data object classes to
manage the storage of your application entities that you describe in the
model. You can do that even for sites with small number of entities in
your data model.
2. Like with UML, is Unit Testing or TDD applicable and appropriate
for PHP scripting or web-application development?

I do a lot of testing of smaller pieces of code (modules) in my
projects, but nothing to the extent or level that seems prevalent
(religious?) with Unit Testing. Again, like UML, Unit Testing seems
to me to work best when using OOP and objects, such as testing each
object separately (methods, properties) before assembling them
together into a project or application. However, if you do not use
objects, does Unit Testing still apply??
Of course. Tests help you make sure that each of the test project parts
work as intended, specially after you keep evolving your project. This
way you can prevent a lot of bugs that otherwise would go unnoticed.

3. If any of the above do apply, can anyone suggest to me some
resources (ie: books, web-sites, articles, etc..) that would be
helpful, preferably with using PHP, but not limited too specifically.

I don't know if my questions are too vague, or too general. Basically
I always try and learn new things and these are two that seem to be
either popular, or just spark my interest. I don't mind spending time
learning something even if it is not 100% applicable to my situation
-- on the other hand, if there is something else out that would be
more so I would rather spend the time learning that instead.


Since you explicitly say that you are limited in terms of time, you may
want to try Metastorage, which is a tool meant to let you design your
data model in a simple XML based format, and then it generates the
schema of the database to store your application entity data objects,
classes to store and retrieve those objects, forms to provide the user
interface to access those objects and even a class diagram in UML
notation with all generated classes.

All this gives you a head start to implement you application without
much less work and in much less time that you would take to write, test
and debug with the traditional (fully hand coded) programming methods.

You may obtain more information about Metastorage here:

http://www.meta-language.net/metastorage.html
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #2
Manuel Lemos <ml****@acm.org> wrote in message news:<bn*************@ID-138275.news.uni-berlin.de>...

For instance, any database driven project could have its data model
described with UML artifacts and you can use data object classes to
manage the storage of your application entities that you describe in the
model. You can do that even for sites with small number of entities in
your data model.

Thanks for the info -- actually I spend almost all of my time working
with databases and manipulating data, so it's good to know. Just
about anything I add to the Intranet site deals with extracting some
data from the SQL Server and displaying it.

Since you explicitly say that you are limited in terms of time, you may
want to try Metastorage, which is a tool meant to let you design your
data model in a simple XML based format, and then it generates the
schema of the database to store your application entity data objects,
classes to store and retrieve those objects, forms to provide the user
interface to access those objects and even a class diagram in UML
notation with all generated classes.

I will certainly look up Metastorage. It's not that I don't mind
spending time learning something (by hand per'se). I don't currently
need either technology to complete my work so there is not a rush to
learn or implement -- I am just looking for something new to learn and
hoping that I can apply it one way or another to the work that I do in
the hopes that it will improve something (less time, better design,
fewer bugs, etc...)

Are there any PHP specific books or sites that you would recommend
looking at, or should I just stick with Metastorage for now?

Thanks again for your reply.

Hugh
Jul 17 '05 #3
Hello,

On 10/28/2003 02:40 PM, Hugh Cowan wrote:
Since you explicitly say that you are limited in terms of time, you may
want to try Metastorage, which is a tool meant to let you design your
data model in a simple XML based format, and then it generates the
schema of the database to store your application entity data objects,
classes to store and retrieve those objects, forms to provide the user
interface to access those objects and even a class diagram in UML
notation with all generated classes.
I will certainly look up Metastorage. It's not that I don't mind
spending time learning something (by hand per'se). I don't currently
need either technology to complete my work so there is not a rush to
learn or implement -- I am just looking for something new to learn and
hoping that I can apply it one way or another to the work that I do in
the hopes that it will improve something (less time, better design,
fewer bugs, etc...)


That is the spirit of Metastorage. :-)

Are there any PHP specific books or sites that you would recommend
looking at, or should I just stick with Metastorage for now?

As for Metastorage, despite the documentation is through, most people
prefer a quick start tutorial. So, I have been working on it lately. It
is not yet finished but the current version is available here:

http://groups.yahoo.com/group/metal-...s/metastorage/

Metastorage applies what is called a Model Driven Architecture (MDA for
short), that consists of building an application or parts of it from a
description of the Model. I am about to review a book about MDA soon. I
am just awaiting for it to arrive. It will be reviewed in these pages:

http://www.phpclasses.org/products.html

Just subscribed to the site to be notified when the reviaw is related.

Meanwhile you may want to take a look at this other book about code
generation. It tells you all about techiniques based on generators that
simplify the development of applications based on repetitive code. This
one of my favorite books I have read. The review is also here:

http://www.phpclasses.org/products.h...930110979.html


--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #4
Hugh Cowan wrote:
Hello,

I don't program full-time (anymore), but I do try and stay on-top of
the latest technologies and like most are always trying to upgrade my
skills and remain current (as much as is possible).

Most of my programming these days involves using PHP for creating
script files for automating tasks and procedures (locally), and also
for anything that might be needed by our divisional Intranet (not a
huge site by any stretch of the imagination).

Two topics that keep popping up at me are UML and Unit Testing, or
Test Driven Development (TDD).

Due to my current situation my time is somewhat restricted and limited
in scope -- and therefore I try and keep things relevant to what I am
working on, in this case it would be scripting with PHP. Therefore I
have a few questions:

1. Is UML often used when setting up web-sites (Intranet or
Internet), or more specifically web-based applications? If so, is it
applicable to using with PHP (or visa-versa).

UML is very broad so it is a very broad question. Regardless of
programming language (OO or otherwise), you can use UML such as use-case
diagrams, sequence diagrams etc. Obviously class diagrams are only
useful to PHP programmers who write object oriented apps.
From my limited understanding of things -- UML to me seems to be used
mostly for OOP programming and Objects, which doesn't really seem
useful for web-site & applications unless you are creating really
*large* and complex sites -- which of course I am not.

couldn't disagree more.
http://www.amazon.com/exec/obidos/tg.../-/0201730383/
2. Like with UML, is Unit Testing or TDD applicable and appropriate
for PHP scripting or web-application development?

absolutely, if that's the way you are used to working.
I do a lot of testing of smaller pieces of code (modules) in my
projects, but nothing to the extent or level that seems prevalent
(religious?) with Unit Testing.
don't be religious about software development. Use what provides good
outcomes for you.
Again, like UML, Unit Testing seems
to me to work best when using OOP and objects, such as testing each
object separately (methods, properties) before assembling them
together into a project or application. However, if you do not use
objects, does Unit Testing still apply??

good question. If you have no object, where are your units?
You would be doing "method" testing, treating a PHP script as though it
were an object and the globals were member properties (imported into
functions witht he GLOBAL directive). People who code procedurally are
probably more likely to hack up some other testing scheme. Not much
point trying to get existing unit-testing software to fit the bill.

it's a moot point.
3. If any of the above do apply, can anyone suggest to me some
resources (ie: books, web-sites, articles, etc..) that would be
helpful, preferably with using PHP, but not limited too specifically.


http://www.phppatterns.com/

http://www.sitepointforums.com/forum...hp?forumid=147
You'll find stimulating discussion on these topics here.

good luck and best wishes.
PS.
Why not check out an OO framework that I am building. It tries to
leverage a 100% OO design to promote code re-use, scalable,
"extendable", maintanable design. It also maximises the use of standards
for content and display separation without forcing you to use a
front-controller or a proprietary templating system.
http://xao-php.sourceforge.net/

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Robert Smith | last post by:
I'm doing a website development course and during an exercise my teacher gave me to do at home I was confronted with errors. Surprisingly, those that did the exercise in class did not receive...
4
by: mirnazim | last post by:
Hi, I was googling for a unit testing framework for php. I stumbled upon 3, all are named PHPUnit. 1) http://phpunit.sourceforge.net/ 2) http://pear.php.net/package/PHPUnit/ 3)...
14
by: | last post by:
Hi! I'm looking for unit-testing tools for .NET. Somthing like Java has --> http://www.junit.org regards, gicio
39
by: Hareth | last post by:
C# 2005 express & vb 2005 express: 1. During runtime, I can edit my codes in C#..... How come this cannot be done in VB? it says ...."read-only" during runtime...... 2. Why does vb...
4
by: Peter Rilling | last post by:
Does VS.NET 2005 Professional support integrated unit testing, or is that only with the team system?
72
by: Jacob | last post by:
I have compiled a set og unit testing recommendations based on my own experience on the concept. Feedback and suggestions for improvements are appreciated: ...
18
by: Andrew Wan | last post by:
I have been developing web applications with ASP & Javascript for a long time. I have been using Visual Studio 2003.NET. While VS2003 is okay for intellisense of ASP & Javascript, it's still not...
2
by: Ming | last post by:
Hi folks, How can I do testing in php? I just did a quick search and I cannot find too much info about it. The one sounds promosing is phpunit.de. Is it the right place? Thanks,
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.