Default Implementations or State. Java Collections Offer Good Examples of This (Map
Default Implementations or State. Java Collections Offer Good Examples of This (Map
Interfaces are more flexible, because a class can implement multiple interfaces. Since
Java does not have multiple inheritance, using abstract classes prevents your users from
using any other class hierarchy. In general, prefer interfaces when there are no
default implementations or state. Java collections offer good examples of this (Map,
Set, etc.).
Abstract classes have the advantage of allowing better forward compatibility. Once
clients use an interface, you cannot change it; if they use an abstract class, you can still
add behavior without breaking existing code. If compatibility is a concern, consider
using abstract classes.
Even if you do have default implementations or internal state, consider offering an
interface and an abstract implementation of it. This will assist clients, but still
allow them greater freedom if desired
What is $routeprovider
$routeProvider is the key service which set the configuration of URLs, maps them with the corresponding
HTML page or ng-template, and attaches a controller with the same.
In service,you dont create an object explicitly,Angularjs instantiates it behind the scenes with a
‘new’ keyword,basically it constructs the object with a constructor function.
app.service(‘myService’,serviceFunction)
app.factory(‘myFactory’,factoryFunction)
var serviceFunction=function(){
//here you will assign the values to this function using ‘this’ keyword
//return this
var factoryFunction=function(){
var someObject={}
return someObject.name;
}
app.controller(‘myCtrl”,function(myService,myFactory){
})
so basically in service it will return the whole instance of function implicitly…but n factory you can
return what ever you want..so you have more control in factory as compared to service.
what is directive? Tell me about directives, services and factory that you created?
Tell me about Routing
3. Node JS. Establish connection between Node JS and MongoDB That's it.
Single Page Application(SPA) is a web application that fits on a single web page with dynamic actions without
refreshing the page. Single Page Application interactions can be handle without reaching server. Single Page
Application can improve performance in several ways like loading time, using AJAX, easy to navigate pages
etc. End users will be more comfortable with Single Page Application, It is very easy to navigate to different
page and filter content. There are many tricks and technique can use to build awesome Single Page
Application. AngularJS is the more popular Single Page Application framework.
What is AJAX?
Asynchronous JavaScript and XML(AJAX). It is not a programming language. AJAX is the method of
exchanging data and updating in website without refreshing the page.
Advantages:
Single Page Application is good for making Responsive Websites, Support mobile, Tablet & Desktop.
No extra queries to the server to download pages.
User friendly.
Performance improvement, Single Page Application can improve performance in many ways, Single time
file load each of HTML, CSS, JS.
Disadvantages:
Client must enable JavaScript, Single Page Application build with JavaScript, So JavaScript should be
enabled in client browser. JavaScript enabled in all modern browsers by default.
Security: Compare to traditional page Single Page Application is less secure due to Cross-site scripting
(XSS).
Memory Leak: Memory leak in JavaScript can even cause powerful system to slow down.
Site Execution plays a major role. According to Think With Google site, a site is a great id its stacking time is under 5
seconds. A site is reasonable if stacking time is 5 to 8 seconds. However, a site is poor if stacking time is over 8
seconds.
Complete your UI design course to get the knowledge on responsive web design
5) Explain the ways to reduce the page loading time?
Decrease picture sizes, remove unnecessary gadgets, HTTP pressure, put CSS at the top and content references at
the base or in outer documents, lessen queries, limit diverts, reserving, and so on.
{ Info: use google page insights to check your page loading time }
Web openness implies a web for distinctively able or incapacitated individuals. HTML5 presented WAI-ARIA so that
even incapacitate individuals can communicate, comprehend and explore a site.
CSS Box Model is the foundation of CSS design. Box Model incorporates Content, cushioning, outskirt and edge of a
component. In the CSS Box Model, each div or component is considered as a rectangular box. That crate can have
content, for example, width and height, margin, padding and border.
Cascading Style Sheets (CSS) isn’t case Sensitive. However, textual style families, URLs to pictures, and other direct
references with the template might be. The secret is that in the event that you compose a report utilizing an XML
assertion and an XHTML doc-type, at that point the CSS class names will be case touchy for some browsers
Open your website page in Firefox. Press Ctrl + move + j. You will see all security, JavaScript and CSS related issues.
You can also utilize W3C validator for HTML and CSS related issues. Indeed, even W3C approval can check CSS
mistakes now.
10) What is a CSS Reset? Differentiate between the CSS Reset and Normalize CSS?
CSS Reset expels program default styles. Normalize css sets a standard overall program (It doesn’t ‘reset’ them).
AJAX is Asynchronous JavaScript and XML. It is customer side procedure written in JavaScript used to get or post
information from a remote server without reloading page
Data Scrapping is getting organized information from the program into a database, CSV document, or Excel record.
Semantic HTML is a coding style where the labels specify what the content is intended to pass on. In Semantic HTML,
labels like for strong, and for italic ought not to be utilized, the reason being they simply speak to organizing, and
give no sign of importance or structure. The semantically right activity is useful and. These labels will have a similar
striking and italic impacts while showing importance and structure (accentuation for this situation).
14) what is the limitation when serving XHTML pages?
Maybe the greatest issue is the poor program support XHTML as of now appreciates. Web Explorer and various
other client specialists can’t parse XHTML as XML. Hence, it isn’t the extensible language it was guaranteed to be
Frames enable a designer to partition a program window into different (rectangular) regions. Numerous records can
be shown in a solitary window, each inside its very own frame. Graphical programs enable these casings to be looked
over freely of one another, and connections can refresh the record showed in one casing without influencing the
others.
No. Most projects that help you compose HTML code definitely know most labels and make them when you press a
catch. In any case, you should comprehend what a tag is, and how it works. That way you can address blunders in
your page all the more effectively.
* Access to the/cgi-canister/to put the getting content. Prewritten CGI record transfer contents are accessible.
To consolidate numerous/halfway templates into one set the TITLE property taking one and a similar incentive to the
LINK component. The joined style will apply as a favored style, e.g.:
Existing HTML style techniques, (for example, <font SIZE> and <b>) might be effectively joined with template
particular strategies. Programs that don’t comprehend templates will utilize the more established HTML designing
strategies, and templates particulars can control the presence of these components in programs that help CSS1
In general, there is no genuine strategy or content for making standard HTML source code not distinguishable. You
may consider doing any of the below in the event that they are worried about your source code.
Make the website page in Macromedia Flash or a comparable program. The guest would need to download the
Macromedia Flash module and would be unfit to see the source code for the blaze applet.
There are different contents that will cripple the correct snap include, keeping the client from sparing pictures or
survey the source. Be that as it may, this won’t secure the source code of your page. For instance, Internet Explorer
clients may in any case click “View” and “Source” to see the source code of the page, or a client could incapacitate
contents and pictures can be spared by just sparing the website page to the hard drive.
There are a few projects that will help scramble your code, making it troublesome (certainly feasible) to peruse.
Once more, this won’t keep somebody from survey your code.
21) The color of the webpage looks different when viewed on PC and Mac Why?
To put it plainly, there is no genuine strategy or content for making standard HTML source code not perceptible. You
may consider doing any of the underneath on the off chance that they are worried about your source code.
Make the site page in Macromedia Flash or a comparative program. The guest would need to download the
Macromedia Flash module and would be unfit to see the source code for the glimmer applet.
There are different contents that will incapacitate the correct snap highlight, keeping the client from sparing pictures
or survey the source. In any case, this won’t ensure the source code of your page. For instance, Internet Explorer
clients may at present snap “View” and “Source” to see the source code of the page, or a client could handicap
contents and pictures can be spared by just sparing the site page to the hard drive.
There are a few projects that will help scramble your code, making it troublesome (certainly feasible) to peruse.
Once more, this won’t keep somebody from reviewing your code.
22) How to make the frame with the vertical Scroll bar but not a horizontal Scroll bar?
The best way to have a frame with a vertical scrollbar yet without an even scrollbar is to characterize the casing with
SCROLLING=”auto” (the default) and to have content that does not require level looking over. There is no real way to
indicate that an edge ought to have one scrollbar yet not the other. Utilizing SCROLLING=”yes” will drive scrollbars in
the two headings (notwithstanding when they aren’t required), and utilizing SCROLLING=”no” will restrain all
scrollbars (notwithstanding when looking over is important to get to the edge’s substance). There are no different
qualities for the SCROLLING property.
DIV is utilized to choose a block of content with the goal that one can apply styles to it. span is utilized to choose
inline content and let clients apply styles to it. The principal contrast among DIV and SPAN will be SPAN does not do
arranging without anyone else’s input. Additionally, the DIV tag is utilized as a section break as it makes a legitimate
division of the record wherein it is connected. This is as opposed to the SPAN as SPAN basically dos the usefulness of
applying the style and arrangement whatever was determined in it.
24) What is the difference between the <strong> and < b>?
<b> is a presentational component used to give bolder look to content. While <strong> gives bolder look and solid
significance in Search Results
<i> is a presentational component used to give italic look to content. While <em> gives italic look and underscore in
query items.
Position relative can move a component as for its present position. Position outright can move a component as for
its present position or parent components position. Total Elements doesn’t consume space in DOM Flow. Position
fixed gives a fixed position to a component regarding the gadget screen. These components don’t proceed onward
looking over. Fixed Elements additionally doesn’t consume space in DOM Flow
in “standard mode” pages are rendered by the HTML and CSS particulars, while in “quirks mode” attempts are made
to imitate the conduct of more established programs.
the window.onload is a JavaScript work through $(document).ready is a Jquery work. Jquery prepared capacity
burdens content somewhat quicker than the JavaScript window. onload work. window. onload hang tight for all
DOM substance including media to stack first and after that executed, though Jquery prepared capacity to sit tight
for just HTML components, not media, hence burden quick.
To connect a picture, use labels. You need to indicate the picture in statements utilizing the source quality, src in the
opening tag. For hyperlinking, the stay tag is utilized and the connection is determined in the href trait. Content to
be hyperlinked ought to be put between the labels. Minimal known reality: href means “HYPERTEXT REFERENCE.”
When connecting to an email, the href determination will be mailto:[email protected].
example:
localStorage.empid=”420″;
CSS media queries are used to develop responsive templates for different layout of screen, print, mobile , tablet or
any other resolutions
CSS media queries can be added in 3 ways as like CSS style sheet :
Inheritance propagates property values from parent elements to their children. The inherited value of a property
on an element is the computed value of the property on the element’s parent element. For the root element, which
has no parent element, the inherited value is the initial value of the property.
A property can also be explicitly inherited by using the inherit keyword in property.
#navtable {
.rounded-corners;
}
#maintable {
.rounded-corners(5px);
}
In simple terms, inheritance is the concept of one thing gaining the properties or behaviours of something else.
Inherited children inherit their parent’s behaviour To say A inherits from B, is saying that A is a type of B.
In JavaScript You must use a special object called prototype.
function Animal() {}; // This is the Animal *Type*
Animal.prototype.eat = function () {
alert(“All animals can eat!”);
};
The effect of this is that any Birds you create (called an instance of Bird) all have the properties of Animals
var aBird = new Bird(); // Create an instance of the Bird Type
aBird.eat(); // It should alert, so the inheritance worked
aBird.fly(); // Important part of inheritance, Bird is also different to Animal
Associative arrays are where we can associate a key string with a value string
JavaScript objects are also associative arrays.
i.e the property emp.Name can also be read by calling emp[‘Name’]
We can access each property by entering the name of the property as a string into the array
it refers to accessing the DOM elements of HTML also [as object or associative array]
6) explain JS Namespace ?
Namespacing is a technique employed to avoid collisions with other objects or variables in the global namespace
and also helps to organize blocks of functionality into easily manageable groups that can be uniquely identified.
JavaScript doesn’t builtin support of namespacing but using objects and closures we can achieve a similar effect.
javascript Namespacing patterns :
1) Single global variables :
var myApplication = (function(){
function(){
/*…*/
},
return{
/*…*/
}
})();
var myApplication = {
getInfo:function(){ /**/ },
// we can also populate our object literal to support
// further object literal namespaces containing anything
// really:
models : {},
views : {
pages : {}
},
collections : {}
};
3) Nested namespacing :
this.reset = function(){
val = 0;
}
}
creator.call(ns);
// ns.next, ns.reset now exist
creator.call(ns2, 5000);
// ns2 contains the same methods
// but has an overridden value for val
// of 5000
for more details on namespace read http://addyosmani.com/blog/essential-js-namespacing/
7) explain Jquery live and bind methods ?
.bind() attacheds events to elements that exist or match the selector at the time the call is made.
Any elements created afterwards or that match going forward because the class was changed, will not fire the
bound event.
$(‘img’).bind(‘click’, function(){…});
8) what is bootstrap ?
there are two types of web service….1. SOAP [Simple Object Access Protocol] Webservice and 2. RESTful
[REpresentational State Transfer] Webservice.
SOAP is a messaging protocol , REST is a design philosophy , not a protocol.
SOAP:
you define your interface in a .wsdl file, which describes exactly which input parameters are expected and how the
return values will look like
there are tools to generate the .wsdl files out of java class hirarchies. JAXB for example
there are also tools to generate java objects/classes as part of eclipse for example (don’t know the name in the
moment).
SOAP is very strict. Every request is validatet against the wsdl before processing.
A good but not so easy to start with framework for SOAP WS is Apache CXF
REST (no hands on experience up to now, feel free to correct and improve ;) ):
a way to access a webserver or web application to retrieve data from or send to it.
it’s only negotiated, how it is accessed.
common is something like this http://server.domain.com/app/type/id=123 to retrieve object of type type with
id=123
very intuitive, but no automatic validation of requests.