SitePoint Sponsor

User Tag List

Results 1 to 21 of 21

Thread: Web Toolkit...

  1. #1
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Web Toolkit API

    For a university subject i'm in a group that is looking to make a server side development toolkit and program generator.

    We are going to make it using php. We want to have database abstraction built in using ADODB or PEAR.

    We are looking to try and create an API to enable dynamic content generation output into different formats: HTML, Flash, XML, WAP whatever... as well as dynamic and customizable data object models.

    Do you think there are too many projects of this nature already? If so, what are they, and how abstract is the toolkit/system? Is customization and extension logical and well done?

  2. #2
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're on the leading edge there First I would say lookup REST (in regard to web services) for a philosophical angle (great for Intro and Conclusion).

    Two I've come across that do something along the lines of what you want are Krysalis and PHPortal.

    Would say in general there's alot more that could be done. These are both "big" projects, aiming ot build complete applications.

    If instead you aimed at something simpler - a PHP class that anyone can use to generate output for their scripts and is capable of taking a set of data and producing Flash (see Ming at php.net), HTML, XML (including XML-RLC and SOAP) and anything else you care to name, and allowing it to be easy to switch from one to the other on user request. Well if you did that, I personally would love you , let alone anyone else.

  3. #3
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    more abstract??

    What i'm going to try and do is set up an api that allows creation of abstract datatypes, that can then be extended into components that can output into what ever format you want.
    We are looking to escape some of the 'hard-coded' mixed up model-view systems that are around (postnuke for eg).
    There is a significant lack of extendable apis that allow for the customized creation of web-based systems, much like some of the (albeit commercial) business systems models (SAP, Oracle). Once someone implements a community system such as postnuke or phpnuke then they are obliged to develop with in those frameworks, which aren't always that adaptable. If as a project, we can develop a standardized system for describing and implementing web-based systems, then it will be much more accesible for people to develop applications from a development point of view and from a design point of view.
    We are looking at basing the project around a system, where by an abstract datatype (for example a community web site, or a forum within that site) can be specified, then extended either by applying design templates or by extending into another datatype.
    If we can we'll use xml as the specification system, and create a framework within datatypes can be created, and their implementation of the datamodel (ie. the database) can be constructed and configured. We'll try to make the framework as abstract as possible, as someone might not even want to implement the framework (the same way someone might want their forum to be how other developers want it to be).
    If someone who doesn't want to know how the framework works wants to customize the design, then that is seperated from someone who wants to customize the datamodel.

    At the moment the project is just beginning, and once i set up a web site i'll pass on the details.

    If a standard way of describing web data and web design is established then hopefully there won't be too much need to keep re-inventing the wheel and developers can focus on customization and new ways of sharing data, ideas and concepts.

    Any way i hope some people are interested, and i really wouldn't mind discussing some of the concepts with some of wizards that around on sitepoint.

  4. #4
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a fascinating subject to be dealing with. In many ways, PHP is "behind" in this area compared to older programming languages. That has alot to do with many PHP developers not having a formal programming background.

    Still recommend looking at REST for a "big picture" to put this project into. It may not seem relevant at first glance but my crude analysis of what REST is try to say is this;

    Rather than having a seperate URI for every "content type" your site will deliver, you should use the same URI and have your application determine what the content should be.

    For example, rather than;

    http://www.domain.com/application/html_output.php
    http://www.domain.com/application/flash_output.php
    http://www.domain.com/application/SOAP_output.php
    http://www.domain.com/application/XMLRPC_output.php

    You should simply have;

    http://www.domain.com/application/

    It's then down to your application to deliver the right content, depending on the client (if browser then HTML, if flash player then flash, if SOAP client then SOAP etc.).

    As such, I think it's directly relevant to what you're planning.

    Recommend you make future posts in the Advanced PHP Forum and get some involvement from Skunk (hot on XML + web services and API building) and voostind (hot on object orientation and application abstration) among others.

    One final comment - it might be interesting to build what you're doing into Smarty - a PHP / HTML templating engine, to extend it to deliver flash, XML etc.

  5. #5
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    REST

    i have been looking at REST architectural system, and it sounds like something to base framework on in order to do what we are looking at.

    Has anyone done any development using this system or knows of some examples?

    i think the address-dependent architecture is a good way to achieve scalability and the level of abstraction we're looking for.

  6. #6
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's this article about Amazon going "REST".

    Personally I think Amazon (or the article) have clouded the issue here - it's not a case of REST vs. SOAP. You could easily deliver SOAP within the REST methodology.

    Believe the general view is most existing HTML web pages have navigation systems based around the GET method (worth reading around the fusebox methodology (articles on PHP builder and Devshed I belive).

    So you have;

    http://www.domain.com/index.php?view=articles
    http://www.domain.com/index.php?view=news

    The approach now with REST is those URI's should be "presentation independent", so you could have Flash, SOAP or whatever output generated there.

    With SOAP, there's no reason why you couldn't do this - this issue may be WSDL doesn't really support it at this time (not sure), allowing you to pass URIs with METHODS.

    But the design approach with say Flash and HTML might be to have a set of templates for either and a class which takes whatever dynamic content you feed it, takes the relevant templates, merges all together and produces the output.

    May be you could even all your project phpREST?
    Last edited by HarryF; Aug 9, 2002 at 00:16.

  7. #7
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved, merged, deleted, split and all sorts. Hey trickie, next time you want a thread moved, contact one of the Advisors (by using the report button) and we'll do it for you.

    (BTW nice topic, and cheers HarryF again for some awesome info).
    I swear to drunk I'm not God.
    » Matt's debating is not a crime «
    Hint: Don't buy a stupid dwarf ö Clicky

  8. #8
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks

    thanks weirdbeardmt and HarryF...

    I think one of the first things im going to start designing is a clear framework of supplying content to the right clients. And finish reading a bit more on REST.

    Another guy in my group is working on a generator that we can use to transform design templates from datamodels. We will try to make it possible to specify the data objects using the same process.

    I'm thinking that we are going to have to prototype out a small implementation of our concept in order to gather all our requirements. That also helps in having to show some sort of progress with assessment. Our lecturer is pretty flexible, but we have to have something for him to give us some marks.

    Our subject is Computer Mediated Communication, and has a major focus on the technologies that enable online and networked communities. The major assignment is making a community site with server side scripting or shockwave. Having done a bit serverside scripting, me and another guy get to set our assignment. We told our lecturer that this will be an ongoing project, and he's pretty cool. He got us some work writing some PHP/MySQL tutes for first year classes.

    anyway i'm working on a site to experiment from, so i'll let you know.

  9. #9
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found this interesting resource on REST:

    RESTwiki

    I like the way the REST architecture supports cross application communication with the simplicity of hyperlinks. Very Nice.

    I'm thinking that the templating of data could easily be left to the client OR done by the server. I like the way a developer can control the output format of the data, but also allow others to create client side templates. You could utilize generic data objects using XML, and if you want provide templates for othet formats, OR you can delay that decision to the client. This technique would lend itself well to domain orientated engineering, with clients being able to access many applications and the single application also able to provide access many implementations of a client.

  10. #10
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thsi sounds like a very interesting project. I've been trying on and off to come up with something like this for the past year and a half, but I never managed to design something that really solved the problem while staying modular enough to allow you to use it without having to develop exclusively within a single framework. I'm learning new things about software design and engienering all the time though so I'm looking forward to having another go at it in the near future

    Good luck - if you share your progress on the Advanced PHP forum here I am sure you will get a lot of useful feedback.

  11. #11
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Community XML

    I think one of the key things to making this project work is a clear understanding of the structure that data should be.

    Here is the first draft of my design...very brief.

    Server specification:

    Framework to map request to URI:

    This will utilize the HTTP methods and will be very abstract. The framework will map from URI to data objects that can be presented according to an XML specification or specific design templates that utilise that specification. This mapping could also specified using an XML specification

    XML Specification (Community XML):

    The framework will work with XML specifications. For this assignment will start to define ‘Community XML’, though any existing or new specification can be developed to run in this framework.

    XML to Object/Object to Template:

    This is a separate framework to convert XML into Objects that can be instantiated.
    This framework will also allow for templates to be specified and applied to instantiated objects.

    Data Objects:

    A data object is created using an XML specification. The data object must have a way to map data to and from a data source. A data source could be a database or an Xlink to another data object or application. Linking should be done on the server side, so that the way to connect, and the nature of a data source, is transparent.

    Community XML specific templates:

    We must create a few Community XML specific data output templates. These don’t necessarily have to be implemented on the server side, and can be implemented buy the client.


    Client specification:

    Connection utility library:

    A simple API to connect to URI, and implement HTTP requests and actions, can be used if so required, or existing clients just need to be able to connect via HTTP.


    Object to Template:

    The client must be able to apply templates to raw data objects if client side processing is needed or preferred. This will be an extension of the server side framework to transform data based on templates.


    Just a first draft...

    I'm not sure if this architecture will help with the problem that skunk talked about, that of making so that existing apps and datasources can be used, and not have to be modified to work within a single framework.

    I think that by using xml specs then we can help overcome this. If all community forums and sites had underlying compatibility with their data, then it would help link and build the community beyond a single site.

    what do you all think?
    Last edited by trickie; Aug 10, 2002 at 17:36.

  12. #12
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent Trickie!
    Beeing the other developer on this project I'm looking forward to develop it!!!

    Let's build this framework up, and when we're finished with it (got our markes for it) we'll release it and if anyone will join us we will have the ground layer set up for further development.
    NuCleuZ

  13. #13
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All in all, I'd say an excellent draft. Particularily like that you're taking into account what the client may wish to do as well as the server.

    Ambitious? Definately but perhaps with some cunning API design it may not be so much work.

    Good luck and I look forward to seeing more. Perhaps some further definitions of what technologies will be used where (DOM XML I note has undergone a big improvement with PHP 4.3.0, for example)

  14. #14
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP 4.3 on Mac?

    I use macosx for most of development, so does Nucleuz, so we are trying to get the php 4.3 alphas compiled, so we can have a play around.

    HarryF, after looking at an interview with Zeev Suraski you posted a link to under PHP Advocacy Website i'm thinking of maybe making the framework for configuration/mapping URI and generation of data objects into extensions. That part of the process would be the most expensive per request, so maybe it makes sense to add that functionality as extension.

    I'm looking at some XML database technologies, and am interested in hearing from anybody that has worked with xml data mapping in regards to databases?

    What are the major pitfalls, and what are the emerging technologies?

  15. #15
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haven't played with native XML databases but a couple of places to look; http://www.xml.org/xml/resources_focus_rdbms.shtml and exist - an Open Source native XML database.

  16. #16
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Another approach

    There's another possible approach to what you're hoping to achieve. It's a web development language called Bento, which brings the object-oriented paradigm to the presentation layer. It gives you the ability to abstract your content in a much more flexible manner than other technologies.

    See http://www.bentodev.org

    Bento is free, open source and non-proprietary, created by a small group of independent developers (of whom I am one).

    The hitch is that the language is still under development. But the real advantages of object-oriented markup over the template-and-script model of dynamic content generation might make it worth considering. And it's far enough along to tell that it works. The site mentioned above, for example, is Bento-powered. There's no better way to work out the kinks than to eat your own dogfood as they say.

    -mash

  17. #17
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The way you seperate content from code is one of the aspects we are trying to come around in a better way with this project, working with objects is a good way to go from a programmers view. There are a lot of template driven systems out there today, but these often requires you to add a lot of markup to the html file you want to output.

    Currently I'm working on a way where the designer will do the interface as normal, then code like:
    <title><span id="title">dummy title</span></title>
    run it through a program and you have a object to work with in PHP:
    PHP Code:
    $obj = new file();
    echo 
    $obj->title("new title goes here"); 
    will print : "<title>new title goes here</title>"

    That way we have presentation layer and code totally seperated. This is somewhat similar to what XMLC from the Enhydra project is doing, but this will be PHP based.

    The input to the program has to be valid XHTML, but that could be fixed by Tidy if you don't code valid XHTML from start of.

  18. #18
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One general remark on templating, which I don't see in any of the existing template systems, is the text to be replaced should itself be an XML like tag, so if any are omitted, a web browser will ignore them.

    Like;

    Code:
    <title><template:header name="title" /></title>
    Then your template parser will replace <template:header name="title" /> with "This is the title" or whatever.

    Having said that, not sure if it's relevant to what you're trying to do.

    Highly recommend further defining what this project will do, relative to the usual 3 tier model of PHP apps;

    Top Layer: Presentation
    Middle Layer: Logic
    Bottom Layer: Data

  19. #19
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    basically anyone will be able to access any of the levels in this architecture, which should make it easier to develop new content, and also adapt existing content.

    Levels:

    1. the data level is accessible from a URI, and will be xml based on a spec. On the server side data could be stored in a database, or as a link to another URI. When you want you can directly access the data object, with nothing done to it, except formatted to xml for the purpose of portability.

    2. The logic is sort of intermixed with the delivery of the data.

    A script might look something like the following:
    PHP Code:
    /** 
     * the server takes an xml file that describes
     * the distribution of the applications  dataobjects
     * in the form of URI's
     */
    server_config(APP_BASE_URI."config.xml");

    /**
     * create the data object
     */
    $app server_distribute_objects($_SERVER['PHP_SELF']);
    $app->output(); 
    The presentation can be applied at the server level if the xml specs define templates to be applied to that uri, or if the client receives a raw xml object then they can do what ever they want with the data

    As for the templating system, nucleuz will work that out, but it should be simple to define a template or even change they way you apply one if you design it to work with data objects.
    Last edited by trickie; Aug 13, 2002 at 16:18.

  20. #20
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    out of scope

    Alright,
    Me and Nucleuz have been mulling around for the alst few days trying to figure out how to capture the architecture that we want in more detail.

    I've come to a few conclusions...
    What we are talking about is definately outside the scope of one subject for one semester, and there is no point quickly trying to lay the foundations.

    CommunityXML will be a specification that hopes to enable structured transmission of information from community sites such as this one. Instead of creating a new way to implement community sites just yet, i think it would be beneficial to create an information structure that people can use within existing frameworks, then later start the creation of a standard way of delivering that information (ie. REST based systems.)

    To that effect, for this project, we are going to try and just start creating the CommunityXML specification, and maybe start using some of the software engineering principles that we have been talking about to showcase our spec, but not embark on architecture just yet.

    Thanks everybody for their input, and are their any comments on the CommunityXML idea?

  21. #21
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by HarryF
    One general remark on templating, which I don't see in any of the existing template systems, is the text to be replaced should itself be an XML like tag, so if any are omitted, a web browser will ignore them.

    Like;

    Code:
    <title><template:header name="title" /></title>
    Then your template parser will replace <template:header name="title" /> with "This is the title" or whatever.
    ASP.NET does exactly this, actually. JSP too, via Struts. You might want to look at how those implementations work.

    It goes something like this:

    Code:
    <body><asp:label id="mylabel" runat="server" /></body>
    Then, in the page code itself, you can go like this:

    Code:
    mylabel.text = 'I want more cookies!';
    mylabel.style = 'color: red';
    You have access to practically every element that runat="server" and has an id attribute. Like this:

    Code:
    <body><div align="center" id="mydiv" runat="server">This is the default text.</div></body>
    Then you could...

    Code:
    mydiv.text = 'This is some text replacing the default text, since it was such a bad default text.';
    mydiv.Attributes("align") = 'right';
    Last edited by M. Johansson; Aug 15, 2002 at 01:24.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com


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
  •