redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
*Stupid Question alert* - Registry
redbullmarky replied to redbullmarky's topic in Application Design
[quote author=Jenk link=topic=108613.msg437946#msg437946 date=1158760846] A Quick example.. In your Registry with Factory - what happens if you request an object that has a dependency? At the moment, the Factory attempts to instantiate the object without passing any arguments, if your object requires the use of, for example, a database object: [code]<?php class SomeClass { public function __construct(DatabaseClass $db) { ... } ... } ?>[/code] You'll get an error with your application. In steps dependency injection, to inject that DatabaseClass object. P.S. edit your previous post, thanks. [/quote] i'll probably regret being so naive when a problem slaps me round the face with a wet fish, but I honestly don't understand the purpose/complexity of patterns. With a function, for example, i pass in some parameters and out comes my result. what goes INSIDE the function is irrelevent as long as it works. With the few classes i've written so far, they have a constructor and methods. i set up an instance, do my thing, and get the results I need. And nothing stops me using my functions and classes again in other projects without changing anything, and they are designed to have no outside dependencies. So what, in laymans, is the purpose of all the extra complexity of 'dependancies', layering, etc? Am i missing something? -
Ok, I've been doing my reading and in all honestly picked up a fair few new tricks and tactics over the last few weeks. However, pinning these tricks to what I'm trying to achieve is the hard part. My problem: I'm trying to redesign a back-end system of mine to take a more multitasking approach. By that, I mean the ability to allow more than one 'module' to run within my environment at the same time by means of a "popup" (though not a nasty popup, more custom DHTML types that i can still drag around, etc). I'll use a proper example of what I want to achieve: lets say i have two modules open. both exist in their own Iframe/DIV (havent decided yet). Lets say one of them is a list of people i want to call/refer to later, the other is a fresh list of ALL people in my database. Depending on whether I use an Iframe or a DIV with AJAX will depend how I get my call list updated (i.e, drag+drop or a simple 'add to call list' button/link next to each result). Now - the structure for the site suddenly sounds quite complex. I have my main application (ie, the desktop with icons to launch these modules), and now i have two seperate modules open. I'm trying to work out the best way to structure my entire code so that not only can the two modules "talk" to each other, both of them can also "phone home" to my main application if needs be. so basically, my site needs a proper 'object' approach that would also allow sharing of resources between all elements. i need to work out (opinions or potential solutions on these welcome): 1, DIV with iframe inside or DIV who's content is loaded with AJAX for each module. Iframes would allow me to keep more seperation but would probably mean not getting the interactivity between each module that i need. AJAX would be great in many ways, only i'm worried about <form>s and their 'method' - get/post, etc, as reloading the main page would theoretically reload the entire application and close all the windows. so i'm guessing i'd need an 'onclick' to call a request to send the form data back to the model, instead of regular 'submit' buttons. 2, where to store the GLOBAL parts that the modules as well as the main application have access to. sessions? file? database? etc 3, whether, due to the seperation, i should treat each module as its own little program with its own MVC system. 4, the structure of the app's core and same for the individual modules. OOP is not totally alien to me, but when i get into 'layers' and the 'extends' / 'implements' operators, it starts to get a little hazy and hard to get ontop of. 5, directory structure for the whole thing. each 'module' needs to be as light weight as possible in terms of what it sets up. literally it should work almost like a 'plug in'. in terms of the coding, that's not my issue and i'd have no problems doing that. but obviously i don't want to get cracking on such a huge thing if i've not thought these things through to start with, as it needs to be relatively future proof in terms of adding things to it. oh and also - it's going to be a multi-user thing too, with each user having different 'desktop icons' and permissions, so that adds extra to the whole thing. So - to you "pattern-meisters" and framework gurus, how would you structure THAT? :) Cheers Mark
-
*Stupid Question alert* - Registry
redbullmarky replied to redbullmarky's topic in Application Design
no worries. i'm trying to keep things as simple as possible. whilst I don't doubt Martin Fowler's knowledge & practices, etc, from what I've read so far, I've not really found it easy to grasp mainly because i find it hard to associate with what i'm trying to do myself. In a nutshell, my main system works as a "desktop", with the modules running in seperate windows (possibly iframes in a style DIV, and basically a script/DOM of their own which causes other issues for me such as interraction between different modules). so as well as considering the structure of these modules, obviously i also have to consider how these modules can work with eachother as well as still being able to interract with the main 'core' of the program, etc. Ok so that's not directly involving patterns yet, but it's still part of trying to nail a good structure for the whole system that allows me to do stuff like this - ie, a browser based, "multitasking" Contact Management system. "multitasking" being the biggest issue at the moment. Cheers Mark -
*Stupid Question alert* - Registry
redbullmarky replied to redbullmarky's topic in Application Design
now you've lost me lol basically i'm in the process of restructuring a huge application (contact management, more specifically applicant tracking). however, i'm trying to build the basics so that it'll be easy for me to adapt/plug in/maintain as i go along. however, the nature of the packages interface is what's causing me the problems in terms of deciding the structure. Jenk, if you'd be kind to spare a little time to advise/help me kick off the basics via MSN (30 mins tops) then that would be spot on. Cheers Mark -
Discussion - Do you separate your JS, HTML, and PHP?
redbullmarky replied to roopurt18's topic in Application Design
[quote author=roopurt18 link=topic=107007.msg437730#msg437730 date=1158732716] redbullmarky, what do you mean by accelerators? [/quote] things like ionCube, etc, that are designed to speed up PHP. Not sure how they work, but they work. but alot of these template engines need them to get things sped up to a 'normal' level, due to the extra parsing involved. me personally - i'd rather cut out the extra parsing from these template engines, and use the accelerator anyway to make my code 'fast', not 'normal'. I'm not saying these templating engines are terrible, as they have alot of other uses, but they're far too heavyweight. as for the speed: with a 'normal' PHP page, the PHP parser does just that - parses the page and we're ready to rock and roll. when introducing this extra level of syntax, eg Smarty, PHP has to go through the page replacing all the custom tags with 'proper' PHP code and then executing the proper PHP code. ok - so it gets cached, but for the sake of a little bit more simplicity for the designers, is it worth it? my biggest gripe with templating engines is the 'justification' that goes with them. ultimately, they're responsible for building a page. - "yes, but xyz engine does this!!!" - should that be the job of the template engine? - "yes, but the files get cached!" - great, so along with all my code and the engines code, i get hundreds of additional pages in the cache? - "its seperating the code from the HTML!!" - is it? is the new set of syntax really that much different to the old? people mistake this many times. replacing one set of code with another is not 'removal'. if anything, it's worse. - "my designers cant break my code!" - if i had a designer that couldnt learn some simple control structures, etc in 30 minutes (foreach, if, echo, etc) then I'm afraid to say that I wouldnt want them working on my project anyway. what this generally amounts to is the coder telling the designer "Listen, I'm the daddy, you're my bitch, you can't be trusted to not break my code so you'll use this instead". the fact that the new version of PHP (6) will be keeping short tags is good enough for me. <?=$hello_world; ?> vs. {hello_world} really isn't that hard. -
[quote author=sarabjeetdhillon link=topic=108731.msg437711#msg437711 date=1158729240] hi all there i need some kind guidance. i am presently workin with php and smarty i dont work on oops. but what i find in other companies is that most of the work they do is on oops. so do i need to implement oops in my projects although i feel more comfortable without using oops. pls guide me what should i do. [/quote] the short answer: put it this way, even if you don't use any OOP in your own projects, it's still worth getting to grips with it. before this year, I knew a bit about OOP but never used it for anything, but now I've changed my whole approach. If another company requires OOP and require that you meet their coding standards, then your arms are tied and you need to play by their rules.
-
*Stupid Question alert* - Registry
redbullmarky replied to redbullmarky's topic in Application Design
Hi Cheers for the response. I had a good look through the article as well as [url=http://www.phpit.net/article/using-globals-php/3/]this[/url] one. I think my main problem with these is the fact that the reasons/justification all seems very 'programmed' (as if its a case of "its the correct way, and thats the way it is"). I do kinda understand why, but the only differences i can see by using this approach instead of globals are: - because a method is used, rather than just setting a variable, checks can be done to make sure something is not being set again (overwritten). - testing. in fact, the BIGGEST reason seems to be for testing purposes, rather than practical ones. and that's pretty much it. so - apart from testing, when/why would i ever need to restore the registry to the previous state? [quote] The way I use it, when an object is requested that doesn't exist, a new one is created, returned, and added to the array of registered objects. Another example of control over retrieving global objects. [/quote] this sounds more like it. can you elaborate on this further (example)? how do you implement this? [quote] P.S. I don't think this is a stupid question at all. I agree one should never just adopt something just because it says it's a good idea in some book. [/quote] yeah exactly, but this is where alot of people's justification for these patterns,etc, comes from which is why they sound so 'programmed'. I gave MVC/templating the time of day and it proved useful, but in this case - I can kinda see why, but can also see easy alternatives, so i'm keeping an open mind on this. Cheers Mark -
Hello Cell0518, In response to obsidian, can I point you to this tutorial too: http://www.sitepoint.com/article/beyond-template-engine whilst it's slightly irrelevent to your initial question, i think it's relevent on how the final project will be structured/coded, etc. For the reasons outlined in that link, as well as other similar articles, I wrote my own (very simple) template class based on the above, which uses PHP instead of its own syntax. Advantages being that it's very lightweight, you don't need an accelerator to compensate for drop in performance, easier to use, and you don't need to learn an entire new set of syntax to get going.
-
MTV (www.mtv.com), NME (www.nme.com) and Virgin (www.virginrecords.com) are good references i think for what you're after.
-
in fact, i probably have a better idea, rather than continuing with your new design. i had a little bit of a look at your old/current site: http://2fr3sh.com/ and i'd probably say that, given a bit of a lick of paint, validation, etc, you should stick to that style, as it's a lot better than the new one. looks a lot more professional (maybe apart from 'games page' and 'funny videos' which wouldnt really suit a web design company). cheers Mark
-
Hi all I've just read my way through this: http://www.phpit.net/article/using-globals-php/1/ regarding using a registry to deal with globals. It's well written, and semi-laymans, but I need someone to go a step further, if possible. 1, can someone explain, in "PHP5 for Dummies" terms, exactly why I should use a registry? 2, doesn't it (like alot of other patterns i've seen) over complicate something that could be relatively simple? 3, is it a bandwagon for people to jump on to prove to others that they're a "proper" coder, to avoid the wrath of their "proper" peers? 4, unless i'm missing the point, all it does is replaces a few lines of 'global' with a few lines of OOP stuff, saying "globals are hard to work out what they're for and will break if you use this class again". But surely when 'delving' into the registry, you still need to know what's in there anyway, and if you don't set it to the registry your main code, the class that uses an object in the registry will break anyway? here's what i'm on about (excuse the bad pseudocode, but you should get my point): The Rong Way (tm) [code] $db = new Database; function test() { global $db; // we can now use $db!!! } [/code] The Correct Way (tm) [code] $registy = new Registry; $db = new Database; $registry->set('db', $db); function test(&$registry) { $db = $registry->get['db']; } [/code] to me, it just seems like replacing one global space with another, which removes none of the issues. if i don't set 'db' in The Rong Way (tm), then my test don't work. if I don't set up the registry in The Correct Way (tm) then it don't work. what's the difference? It's mad, because when I see alot of the responses to questions similar to mine, the normal response is "because it's the proper way, and that's that. [insert expert here] said so in his book." Of course, I used to think the whole MVC was a load of rubbish but now I employ it (albeit in a very loose and "wrong" way), so I'm open to comments on this one. Cheers Mark
-
it's starting to take shape. my other comments still stand: - the sections (about us, man in charge, get a quote, etc) need some containment, IMO. - get a quote: cluttered + clumsy. for example - the question that asks me how many pages. i have room to type about 19 characters. you can make the box much much smaller to free up space. also - your navigation could be better. ok so there's rollover effect, but it just doesnt look right at all just being plain text. the site is too light as a whole, with the light blue/green on white. you need to darken the colours down a bit or employ some darker shades just to bring the edge off it. all in all, i think it's OK - but needs work. Cheers Mark
-
it's very clean, and the colours so far are good, but ulitimately at the moment it looks very plain. too much text and too much whitespace: - maybe it'd be worth looking at a few 'warmer' colours (to add to your current, rather than replace) just to bring things up a touch. i've seen orangey colours work very well with blue in the past. - i think your header needs some sort of graphic - not necessarily something too prominent, but just to make it less plain. maybe a part-opaque background image. - when i visit sites and see the domain name in the header written in relatively plain text like that, i'm always reminded of those 'domain parking' sites. maybe a non-domain title might be worth looking at. if the 'CA' is important, I'm sure you could think of a nice way to still incorporate it. - you definitely need some additional stuff in the left column, as your 4-tier nav looks a little lost there on its own and kinda draws attention to a large empty space. i think it's a good start but it definitely needs livening up a little, IMO. Cheers Mark
-
[quote author=steelmanronald06 link=topic=108440.msg436794#msg436794 date=1158614179] Dude, their right you know. It is better on the environment to share ;) I mean you have people telling you to carpool, recycle paper, recycle cans, etc...why not carpool internet :-D [/quote] while you're at it, find out who it is and which is his car. take it out for a spin to the shops instead of buying your own. you could also move into his flat and eat his food too, as that would save on rent, food and electricity bills hehe just kidding. as for the 'net, i wouldnt worry too much about it. if you were that worried, you would have just got your own connection instead of asking, so i think you already kinda know what you'll decide :) keep us posted.
-
whilst you have 'tabs' above your different sections, the sections themselves have no 'containment'. a border extending from the tab to contain these parts would help. your colour scheme is not good. light(ish) blue text on a white background, IMO, is a big no-no, but there's something dodgy in general. i'm not a proper designer, so can't put my finger on it or pick the right words, but it's not pretty. your 'get a quote' section looks both cluttered and clumsy. the pieces need air to breath, which even my first point wouldnt solve. doing it in pure CSS is a waste of time if you have [url=http://validator.w3.org/check?uri=http%3A%2F%2F2fr3sh.com%2Fnew%2Findex.html%23]28 validation errors in it[/url]
-
[quote author=steelmanronald06 link=topic=108440.msg436282#msg436282 date=1158539011] [quote author=448191 link=topic=108440.msg436266#msg436266 date=1158535963] Easier would be to either stop doing it and get your own ISP, or ignore your conscience. ;) [/quote] Go with choice B!!! YAY for ignoring the conscience! [/quote] haha i wonder what option you voted for in the "is piggybacking wrong?" poll :) i'd say carry on. surely the fact that you cant find out easily who they are, it must be harder for them to find out who you are. I blame the ISP's as they don't always make it loud and clear how to prevent stuff like that. and if your conscience is that strong, tell yourself that sharing is doing your bit for the environment by cutting down on the number of cables and invoices your ISP has to send out :)
-
[quote author=steelmanronald06 link=topic=107859.msg436204#msg436204 date=1158524770] it's always better to do it custom so when you later want to go back in and add/take away, you know exactly how the code works since it is your own. [/quote] yeah i'd mostly go with that. although the 'purists' will tell you that you need to document/structure your code in such a way that would allow any programmer to jump in and pick up where you left off. me personally, i disagree slightly with these purists and code everything i do from scratch the way i choose to. the only 3rd party scripts i ever use are bits and pieces of javascript, but as i'm getting ok at that, i'm writing all that sort of stuff myself as i prefer to. where's the fun in using other peoples scripts? yeah sure it saves time, but i never feel like i've done my own project and don't feel satisfied if i feel like i've made something that's a glued together, patch-up job of loads of 3rd party stuff.
-
$20 or whatever is probably not such a bad thing, considering its use to you and the fact that you want it for life. either way, i did another google search: [url=http://www.google.co.uk/search?q=open+source+converter+mov+wmv]http://www.google.co.uk/search?q=open+source+converter+mov+wmv[/url] and came up with: [url=http://www.theinquirer.net/default.aspx?article=33380]http://www.theinquirer.net/default.aspx?article=33380[/url] and [url=http://www.softpedia.com/get/Multimedia/Video/Encoders-Converter-DIVX-Related/MediaCoder.shtml]http://www.softpedia.com/get/Multimedia/Video/Encoders-Converter-DIVX-Related/MediaCoder.shtml[/url] which is free (GPL) by the looks of things hope that helps
-
haha yeah definitely sent one. check your junk mail as most of my emails (for some reason) keep turning up there. still... thanks for the links! had a good look, etc. when i first got into doing sites, i tended to use any photo i could find on Google, etc, without even really thinking about issues and stuff. silly i know, but now i'm alot more serious in what i do, i'm more concious about things like that but still one to cut corners with the cost :) thanks Andy
-
Hi Andy Not sure if you got my email a while back re yours, but I like it alot. Where did you get the images from, or can you recommend a cheap/free place to get decent stock photos free for commercial use? Cheers Mark
-
Hi all I'm looking at turning my site (http://www.crashandburn.co.uk) into a proper 'Web Design' site, but i'm a little stuck for ideas, mainly on content especially for the front page. I want to keep it relatively informal, but still professional at the same time (ie, no Comic Sans fonts or Table layouts). And obviously I want to show my worth, but don't want to resort to AJAX and Flash and little tricks all over the place. Possibly i'll have a download section for a few scripts, as a few I use at the moment that i've developed, I'm quite proud of and work very well for me. So...not looking to rip off anyone here, but I'd be keen to see everybody's main web-design site, whether it be a company or individual developer. Just so we have some guidelines here - I don't want to see posts+links from anyone cheeky enough to think that their social-networking/personal/shopping cart/hosting site is what I want to see, although if someone has a site that might not yet be live (ie, under construction, etc) and has any tips to share, fire away. Post your links! Cheers Mark
-
i actually wish i'd went onto university to continue my programming, as I leaned C++ pretty well and enjoyed it loads. back when I had an Amiga, I had a program called AMOS Professional and Blitz Basic, which were versions of BASIC aimed at game developers (Worms was conceived on AMOS, I think Skidmarks (racing game) was made on Blitz, so definitely not "BASIC for wimps" lol). Unfortunately I got a job that consumed all my time, so pretty much gave up, and by the time I got back into it I was too rusty and didn't have as much time to re-learn. Shame, cos game programming is extremely fun. but now, i'd say web development (PHP), but only cos it's about all I know these days.
-
to be honest, i'm not embarrassed by my own personal reasons for having a myspace account for music. like i say - it allows me to get feedback from total strangers on my music, lets me make improvements, etc. i'm also a member of a music forum, but the people there are like me - they are into writing/recording music, or into critiquing the TECHNICAL aspects of music, not the artistic, so feedback from there isn't necessarily the sort of thing i wanna hear. with my friends/family, their critique is biased. myspace is exactly the sort of people i need - varied, mostly into music, critical, etc. i reckon if they modelled it more around music and less about social networking, it'd be much "cooler". but probably much less popular. i get a *slight* feeling that there are a few here that may actually own a myspace account but don't want to admit to it for fear of sounding like a bandwagon-jumping teenager lol still. each to their own.
-
much better. maybe it was the uneven heights of the columns that seemed out of place... as you don't have the blue background any longer, i'm not sure though if the header/footer are too wide (slightly) for the 3 columns. doesn't look bad, but just wondering if it'd look better otherwise. otherwise, spot on.
-
the style changes in the new one are much better, including the header/logo/3 coloured panels. however, the layout in the old one was better, with the text inside the 3 boxes instead of underneath, and the text above/below them.