SitePoint Sponsor |
|
User Tag List
Results 51 to 75 of 274
-
Nov 11, 2004, 17:06 #51
- Join Date
- Jul 2004
- Location
- Canada, Qc
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tony Marston
http://www.martinfowler.com/eaaCatalog/
-
Nov 11, 2004, 17:06 #52
- Join Date
- Apr 2003
- Location
- London
- Posts
- 2,423
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Hi...
Originally Posted by Tony Marston
yours, Marcus.Marcus Baker
Testing: SimpleTest, Cgreen, Fakemail
Other: Phemto dependency injector
Books: PHP in Action, 97 things
-
Nov 12, 2004, 00:29 #53
- Join Date
- Dec 2003
- Location
- oz
- Posts
- 819
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tony Marston
I also feel that encapsulation is one of the most imortant rules, and splitting up classes does add a layer of complexity. I don't know if one way is 'better' than the other, but I prefer the simpler method of a single class, and only feel a seperate mapper class is required for very complex systems with a badly designed legacy database design that needs complex mapping between objects and the database.
People that ignore the KISS principle can end up with a horrid system that is horribly difficult to use and maintain. I've seen systems that are worse than proceedural code with globals all of the damn place. And at the end of the day, the point of design and OOP is for easy maintenance.
-
Nov 12, 2004, 03:28 #54
- Join Date
- Jan 2004
- Location
- Oslo, Norway
- Posts
- 894
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by lastcraft
Dagfinn Reiersøl
PHP in Action / Blog / Twitter
"Making the impossible possible, the possible easy,
and the easy elegant" -- Moshe Feldenkrais
-
Nov 12, 2004, 03:33 #55
- Join Date
- Jan 2004
- Location
- Oslo, Norway
- Posts
- 894
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by kuato
Dagfinn Reiersøl
PHP in Action / Blog / Twitter
"Making the impossible possible, the possible easy,
and the easy elegant" -- Moshe Feldenkrais
-
Nov 12, 2004, 04:21 #56
- Join Date
- Jan 2004
- Location
- Oslo, Norway
- Posts
- 894
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tony Marston
But data storage code is not a natural part of a domain object. For example: a product has a price. So the price is an essential aspect of a Product object. On the other hand, how the Product object is stored--in a database, in an XML file, or somewhere else--is not; it's incidental. That's the main reason why Data Mappers are a good idea.
-
Nov 12, 2004, 05:55 #57
- Join Date
- Oct 2004
- Location
- Sutton, Surrey
- Posts
- 259
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by lastcraft
Originally Posted by lastcraft
Originally Posted by lastcraft
Note that the move to MySQL version 4.1 and above is the same as switching databases as the database APIs are different.
Originally Posted by lastcraft
Last edited by Tony Marston; Nov 12, 2004 at 06:28.
-
Nov 12, 2004, 06:02 #58
- Join Date
- Oct 2004
- Location
- Sutton, Surrey
- Posts
- 259
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by MickoZ
Originally Posted by expert
-
Nov 12, 2004, 06:14 #59
- Join Date
- Oct 2004
- Location
- Sutton, Surrey
- Posts
- 259
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by lazy yogi
By following the KISS principle I took my own 2-Tier development environment and converted it to 3-Tier, then built a family of 6 transctions instead of their 2. How long did it take me, with my outdated methods and simplistic approach? Just 2 weeks. So what those 'experts' failed to achieve in 3 man-years I polishd off in 2 man-weeks. That is why I have a low opinion of so many 'experts'. They can talk the talk, but they cannot walk the walk.
-
Nov 12, 2004, 06:18 #60
- Join Date
- Oct 2004
- Location
- Sutton, Surrey
- Posts
- 259
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dagfinn
-
Nov 12, 2004, 06:27 #61
- Join Date
- Oct 2004
- Location
- Sutton, Surrey
- Posts
- 259
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dagfinn
I do not have data storage code in any business object. I have a separate data access object which constructs all sql queries and calls the relevant database API. All I have in each business object is an array of column names, and this array is passed to the DAO for processing. The business object does not know how the DAO deals with each query, just that it does. Isn't that how it's supposed to work?
-
Nov 12, 2004, 07:59 #62
- Join Date
- Oct 2004
- Location
- downtown
- Posts
- 145
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hmm, seems like people are getting in flame mode here. Lets try to keep it nice
I'll just be off then, before it goes nuclear
-
Nov 12, 2004, 09:26 #63
- Join Date
- Jul 2003
- Location
- Los Angeles
- Posts
- 199
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dagfinn
-
Nov 12, 2004, 10:58 #64
- Join Date
- Apr 2003
- Location
- London
- Posts
- 2,423
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Hi...
Originally Posted by Tony Marston
Have I walked into some kind of Turing test?
Originally Posted by Tony Marston
Originally Posted by Tony Marston
Originally Posted by Tony Marston
Originally Posted by Tony Marston
WidowMaker (we know who you are) mentioned going Nuclear...
You are fond of emphatic statements, presumeably to sound authoritive, so at the risk of being bounced by the moderators I'll make one. You're bullying tactics may work on the much broader Usenet groups, but Sitepoint is different. I know of no member of this forum that is not willing to learn and the majority (like myself I hope) are doing their best on that journey. As a result there is a rare degree of skill and understanding here and no one gets an easy ride. You expect people to painstakingly read your first attempts at OO design when you yourself cannot even be bothered to read the standard texts? You claim you are not arrogant?
It's like some local thug suddenly gaining entry to criminal gang and finding themself out of their depth. You bravado just sounds shrill and desperate.
yours, MarcusMarcus Baker
Testing: SimpleTest, Cgreen, Fakemail
Other: Phemto dependency injector
Books: PHP in Action, 97 things
-
Nov 12, 2004, 11:33 #65
- Join Date
- Oct 2004
- Location
- downtown
- Posts
- 145
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You are fond of emphatic statements, presumeably to sound authoritive, so at the risk of being bounced by the moderators I'll make one. You're bullying tactics may work on the much broader Usenet groups, but Sitepoint is different. I know of no member of this forum that is not willing to learn and the majority (like myself I hope) are doing their best on that journey. As a result there is a rare degree of skill and understanding here and no one gets an easy ride. You expect people to painstakingly read your first attempts at OO design when you yourself cannot even be bothered to read the standard texts? You claim you are not arrogant?
It's like some local thug suddenly gaining entry to criminal gang and finding themself out of their depth. You bravado just sounds shrill and desperate.
-
Nov 12, 2004, 11:35 #66
- Join Date
- Apr 2003
- Location
- London
- Posts
- 2,423
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Hi...
Originally Posted by Version0-00e
.
yours, Marcus
p.s. I was going to report my own post to the moderators, but it seems you can't. Funny old world...Marcus Baker
Testing: SimpleTest, Cgreen, Fakemail
Other: Phemto dependency injector
Books: PHP in Action, 97 things
-
Nov 12, 2004, 11:59 #67
- Join Date
- Jul 2003
- Location
- Los Angeles
- Posts
- 199
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Marcus,
You've always been one to keep your calm and are right up there with Harry and Voostind(we miss you Voos!) for being the most respected members of the PHP community.
However, I can't blame you one bit for getting a bit nasty toward Tony and it was actually quite fun seeing that side of you
Originally Posted by lastcraft
I've now dumped that portal project and have started fresh focusing only on PHP5 and having a blast writing code that works within the Mojavi3 framework(kudos to Sean for such an excellent framework).
-
Nov 12, 2004, 12:55 #68
- Join Date
- Jul 2004
- Location
- Canada, Qc
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I like to be analytical and that with people comportement also. I must admit and if you analyse people, that if someone talk differently or is direct in his thought, the mass often react in a bad way (like Tony is doing). I doubt Tony has bad intention but he is also doing assumption like other are doing.
Probably all we are discussing here are very similar, but just implemented a different way.
An attitude might make you mad (like Tony's one) but you may want to go beyond apparence.
Tony is probably documenting his stuff because he is proud of his solution (bragness which is nothing bad IMHO) and of course also because he wish to educate people or help people learn. That is also probably the reason he is replying to all those post. Same with lastcraft, etc. ;-) I guess for some little word or a more direct tone, people get a bit nervous/annoyed. I would suggest to not worry much about this. It is often just a tone, a way to act. Actually Tony's writting has a direct tone with some arroangace we could probably say (I would classify this in a kind of humour).
lastcraft, you might want to read and just look at the tony's way to do thing, it is an interesting thing and then you can see if it is what you think or not (you claim you haven't done it, but maybe you took a look... however, it is better to check it).
I guess we can all be direct, criticize (an hypothetically way) and give our opinion. That way we can all evolve well (Tony included!). He has never said his way was the only way or what, but from his claim, his way seem efficient and productive and is probably very similar to some pattern. It is maybe just not separated as much as some would want to do.
Actually by looking fast at his stuff, there would probably be an easy way to add a user domain class (i.e. User); rename his actual User class to something like UserTableHandler (sorry don't go ahead and criticize the name) and in User provide method so it can go to an array so it can be used like an object: User->properties, etc. But then Tony would probably say that it is adding one level of complexity to much because apparently his way support all he need. ;-)
-
Nov 12, 2004, 14:37 #69
- Join Date
- Apr 2003
- Location
- London
- Posts
- 2,423
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Hi...
I am about to add "off topic" to my sins. Oh well...
Originally Posted by MickoZ
Now I will make exceptions to people who ask me nicely for a design or code review. I may make some good suggestions, or just bad ones, or mad ones. Whatever happens there is the chance that the discussion will spark off something interesting. Even if it doesn't I may have helped someone in the same way I get help. Without people contributing their time then you don't have a community. If people won't listen then people won't contribute.
And this community is exceptional.
Several projects have been spawned from this forum because of the freedom to discuss half formed ideas in an open way. You only have to look at the progression of MVC debates, and now persistence, to see that happening. I haven't seen much of that on this thread. I have seen lot's of misleading advice. Qualifying just one piece of this bogus advice has been like banging my head on a wall.
Rudeness and stubborness are not characteristics we can live with, they are extremely damaging in a forum. They intimidate those who might challenge. In so doing they leave a trail of poor quality information (dismal in this case). I have obviously tarnished my own reputation in this exchange, but I feel something has to be said. I'll try to be polite (I fail often), but I am not a pacifist.
Sorry, but I don't tolerate rudeness or intimidation here or anywhere else.
yours, MarcusMarcus Baker
Testing: SimpleTest, Cgreen, Fakemail
Other: Phemto dependency injector
Books: PHP in Action, 97 things
-
Nov 12, 2004, 17:28 #70
- Join Date
- Jul 2004
- Location
- Canada, Qc
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Offtopic too (but I believe a topic can sometime need other kind of interaction...
)
Yeah, some people bash too fast. Personally I believe discussion should be done in a honnest way. You don't agree or don't understand or what, said it. Of course Tony's tone sound attacking for a lot of people, I don't know what his intention is.
I will have to take a peek at the thread of MVC and Data Persistance mainly.
I sometime find myself reading too much thread, article, etc. I of course more I evolve think to do bigger stuff, cleaner, more flexible, etc.
I think my major problem is the lack to FOCUS. I guess you have a good reputation in OO related topic, would you have a good roadmap to begin to be "better". I know/understand OOP at basic (at less I think I do), have saw that at school often and was not bad in it (being modest
). But I mean going further in OOP, not learning useless stuff but getting to understand better architecture, maybe the pattern stuff (often I check at pattern and they seem to be similar to "idea" I got... I guess that is why we call them a pattern).
Well my question is this: what you suggest as reference/roadmap if you can suggest that?
I believe school is efficient often for me because it gives me a roadmap. I don't need to listen to all what teacher say or what, but the class give me a checklist of thing I need to learn. example:
1. OOP Basic
--> go there or read that
2. You should then learn X (Pattern)
good link:
good book:
3. You should read those book:
martin fowler - POEEA
4. ...
etc.
I am looking for something clear, reasonable, etc. Probably the bluechip, the best thing to go on. If I need to lead someone to learning PHP let's say, I can give him some directive, lecture so he learn it very good in 2-3 days let's say (if not less). Of course when it comes to architecture there is a lot of more thought and possibility to do (or advanced php programming), but usually the concept can always be mastered a "simple way" (what is simple is good, it is sometime hard to make something simple, but once it is simple it rocks.)
Well if you can give me suggestion, I would appreciate
-
Nov 12, 2004, 17:48 #71
- Join Date
- Oct 2004
- Location
- Sutton, Surrey
- Posts
- 259
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tony Marston
Originally Posted by lastcraft
Originally Posted by lastcraft
Originally Posted by Tony Marston
Originally Posted by lastcraft
Originally Posted by Tony Marston
Originally Posted by lastcraft
How can having a data access object possibly break encapsulation?
You should also be aware that switching from MySQL version <=4.0 to version >=4.1 requires the usage of a completely different set of APIs, so it is very similar to switching from one DBMS engine to another. Therefore I have one DAO class which uses the mysql_* functions, and another which uses the mysqli_* functions, so I can easily make the switch from one to the other.
Originally Posted by lastcraft
-
Nov 12, 2004, 18:03 #72
- Join Date
- Nov 2001
- Location
- Bath, UK
- Posts
- 2,498
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tony Marston
)
DouglasHello World
-
Nov 12, 2004, 18:17 #73
- Join Date
- Jul 2004
- Location
- Canada, Qc
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tony Marston
But you probably done project management or writting stuff.
You can put 10 topics separated with header in one document. You can make 10 documents. You can make 3 classes, you can make 1. But in a design/analysis context the X concepts are still there.
If you write 1 document divised in 10 sections, or 10 documents (covering 1 section/topic each) you still have 10 section aren't you? ;-)
It is easy to think that analyticelly an User has some property, message, etc. in OOP. And that the action to persist is something else. You can bind everything, there is relation, but you can also separate some part, usually we do this with major part.
It is like in your validation routine (in your example).
You can do
Code:function validate () { if type == x { ... code } else if type == y { ... code } else ... }
Code:function validate () { if type == x { validate_x(...); } else ... }
You probably know and understand all this ;-)
-
Nov 12, 2004, 18:31 #74
- Join Date
- Oct 2004
- Location
- Sutton, Surrey
- Posts
- 259
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by MickoZ
- Teach youself.
- Be taught by someone else.
Teaching yourself involves reading books and articles, dissecting other people's code to see how it works and how it is put together, then trying your own code to see if it works.
Having a teacher means having someone who can give you the benefit of his experience, can suggest better ways of designing or coding, and can spot when you are going down the wrong path and put you on the right one.
The best way is a combination of both. But beware! Just as there are books and articles out there which preach some questionable theories, there are also some people out there whose ability to misinterpret and misapply those theories (questionable or not) just boggles the mind!
I have read many books, both good and bad, and been taught by many people, both good and bad, so how do I tell the difference between good and bad? I use the old technique known as 'suck it and see!'. I try it, and if it works I use it, and if it doesn't I loose it. At the end of the day the only REAL thing that matters is that you produce code which works AND which can be understood and maintained by others. This is VITALLY important if you are working as part of a team.
As for all those design patterns, levels of abstraction, classes for this and classes for that - they are all different depending on which 'bible' you read and follow. I do not follow any particular 'bible' with religeous ferver, therefore I am treated by some (no names, no pack drill!) as a heretic. If I follow any religion at all then I must be a devout pragmatist. Dogmatism just isn't my scene, man.
There is no 'one way', no 'true way' to design and write code. There are as many different ways as there are grains of sand in the desert. It is simply a matter of sifting through all those possibilities until you find something that makes sense and that you can make use of. Happy hunting!
-
Nov 12, 2004, 18:43 #75
- Join Date
- Jul 2004
- Location
- Canada, Qc
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well Tony, I won't buy all pattern and stuff. But having thinking of some design and looked fast fast at some of the pattern, some of them look like idea I have (not all of course), so I want to see what is the supposed clean way people have used for them ;-)
There is book that might waste your time and not other, but there is book that are really good and most people can read and get a good understand of something. A book has the advantage to be structured, etc. Like a class, or a roadmap.
Of course you try to avoid the so-called expert because your experience has been bad or what. Standard is GOOD and BAD and all smart people know this. I guess most thing have a good and bad side.
If they are called pattern, it is either that they fit to fix some common problem (pattern to do something) or that people often do it that way (a pattern way). They might just inspirate us and it is nothing (and I doubt people do that 100%) to follow 100% to the letter. But if you take something like Singleton, it is useful, it is simple, it is a clean way to do it. You may or not have read about those DataMapper/ActiveRecord/Etc. However, they might also give you a clean way to do stuff. Some of the stuff are quite intuitive, some less. Blah blah.
Bookmarks