473,715 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3739
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
2430
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 these errors. I told him about the errors and we concluded that this was happening due to the computers in class running php 4.3.2 and my computer is running php 4.3.6. However I was told the way I solved the problem was uneligant code. He said I...
4
1771
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) http://pear.php.net/package/PHPUnit2/ I am confused. Can anybody help me out and tell me what is happening
14
2746
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
2381
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 automatically show the errors, but C# i have to build the app b4 errors are underlined in my code?
4
2163
by: Peter Rilling | last post by:
Does VS.NET 2005 Professional support integrated unit testing, or is that only with the team system?
72
5253
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: http://geosoft.no/development/unittesting.html Thanks.
18
2396
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 that great. One of the cons of ASP & Javascript is that they're both interpreted, which means one has twice the amount of work to do interms of syntax checking & semantic/runtime checking. Another bad thing is that ASP & Javascript doesn't have...
2
1359
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
8717
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4475
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3174
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.