Tuesday, October 1, 2013

What is Data Logic Layer (DLL), Business Logic Layer (BLL) And User Interface (UI) ?



It is part of 3-tier or can be used in N-layer architecture. We will start architecture where it is used. Each name itself explain little bit what they exactly mean.
Basically 3-tier included all this, in Tier application we are dividing application into different modules (Layers) to reduce the complexity and more efficient code & easy to manage.


DLL (Database Logic Layer/
Data Access Layer): As name states, all the concept regarding the Database will go here. Your connectivity, Query, Manipulation, Execution of SQL Query and so on. Will take the same example where you are doing calculation and want to store the values or history in some database table. All the logic will go here. 
 
BLL (Business Logic Layer): As name states, all the concept what you do with Business will go here. Basically you can say if i am building Calculation application now all the Calculation logic can reside in this layer. You can have interface here and there implementation in this layer for simplicity.

UI (User Interface): User Interface is what user see, it will contain all the controls, Java Script which is user facing. You should not write any logic in User Interface area just your UI controls and so forth.

Are the 3 main layers to develop 3 tier architecture.

The UI
(User Interface) layer is the one which is our .aspx with code behind file. So what ever we create the .aspx pages, those comes under the UI (User Interface) layer of the architecture.

BLL
(Business Logic Layer)  or the Business Logic Layer is the one, where we can define the business logic, business object or lets say the properties and method which will interact to other layers through out the application.
So in BLL, we can define the public properties as well as the constraints or rules so that before sending the data to the database, we can check it and if it violates the rules, then get the error back to UI
(User Interface) layer. 

Hence no need to propagate the data to the DAL.
DAL is one the important layer where we define all the methods related to database transactions- Insert, update, Delete, select etc.
So all the stuff which we do at our code behind related to database, is the part of Data-acess layer.

Tuesday, July 30, 2013

Can't Run AMFPHP In PHP 5.3.8 It's So easy to RUN Dude...

I tried the AMFPHP environment PHP 5.3.0
http://localhost/amfphp/browser/
I got a message .....  That's Really Weird !!
Function eregi_replace () is deprecated .
C: \ xampp \ htdocs\ amfphp \ core \ shared \ util \ MethodTable.php on line 505
Error retrieving service info:

Now,
 I can do two things about this small problem :
  1. Change the settings in your php.ini file to disable the deprecated warnings.
  2. Replace the php code in that specific amfphp core file, using the new equivalent function.

Personally I suggest you do the second if 1st one works. 

Why are we waiting for.....? Go -- :)

  •   Change the php.ini file


Thursday, May 23, 2013

Write A Text File

For Writing a Text file we make three files in one folder.
  1. index.php [ which contain some HTML input container and a submit button]
  2. filewrite.php [ it is a server script page]
  3. file.txt [create a blank text file]


index.php 

------------------------------

<form action="filewrite.php" method="POST">
     Name:<input type="text" name="name"><br>
     Pass:<input type="text" name="pass"><br>
     Type:<input type="text" name="type"><br>
     <input type="submit" value="Submit"><br>
</form>

----------------------------------

filewrite.php

----------------------------------

<?php

$file = fopen("file.txt","a");// "a" means append 

fwrite($file,"name:".$_POST["name"]."\r\n"."type:".$_POST["type"]."\r\n"."pass:".$_POST["pass"]."\r\n");

fclose($file);

?>
---------------------------------

Run the index.php file then see what happen ..
it's too simple to write a text file.
Go and open your  " file.txt " .....

Keep Smile  :)