[PDF] angular architecture pdf
[PDF] angular banking application
[PDF] angular best practices
[PDF] angular books free
[PDF] angular cli argument
[PDF] angular cli cheat sheet
[PDF] angular cli commands
[PDF] angular cli commands cheat sheet
[PDF] angular cli component naming convention
[PDF] angular cli configuration could not be found
[PDF] angular cli configuration environment
[PDF] angular cli configuration file
[PDF] angular cli configuration flag
[PDF] angular cli configuration is not set in the workspace
[PDF] angular cli configure proxy
Architectural patterns
Open Source & DOTNET platform
Understandingarchitecturaldesign
patterns(likeMVC,MVP,MVVMetc.)is essentialforproducingamaintainable, clean,extendableandtestablesource code. MVC
Controller
MVC Model fordatameanshowthedatacanbechangedand manipulated. View
TheViewrepresentstheUIcomponentslikeCSS,
Thisalsotransformsthemodel(s)intoUI.
Controller
thecoordinatorbetweentheViewandtheModel. MVP
Presenter.
usedwithwindowsforms. MVP Model datameanshowthedatacanbechangedand manipulated. View
TheViewrepresentstheUIcomponentslikeCSS,
Thisalsotransformsthemodel(s)intoUI.
Presenter
other'sbyaninterface. trafficascontroller.
KeyPointsaboutMVPPattern:
UserinteractswiththeView.
ViewismappedtoonlyonePresenter.
MVVM
MVVMstandsforModel-
View-ViewModel.This
patternsupportstwo-way databindingbetweenview andViewmodel.This enablesautomatic propagationofchanges, withinthestateofview modeltotheView.
Typically,theviewmodel
usestheobserverpattern tonotifychangesinthe viewmodeltomodel. MVVM Model manipulated. View
ViewModel
This pattern is commonly used by the WPF, Silverlight, Caliburn, nRoute etc.
Key Points about MVVM Pattern:
User interacts with the View.
There is many-to-one relationship between View and ViewModel means many View can be mapped to one ViewModel. View has a reference to ViewModel but View Model has no information about the View. Supports two-way data binding between View and ViewModel.
Open Source Development
Framework for developing
web applications
Using Spring MVC
Java Web DevelopmentFramework
Thereareamajorityofenterprisesrunning
JavaapplicationsandworkingonJavaweb
developmentframework.Whatremainsto beseenisthatanumberofcompaniesare tiedtotheconventionalwebdevelopment frameworkandhaǀen'tactuallystartedto anticipatewhatcouldbethebestJavaweb developmentframework.
10 best Java web development framework
1.Struts2
2.JSF(JavaServerFaces)
3.SpringMVC
4.Wicket
5.Stripes
6.Tapestry
7.RIFE
8.Seam
9.GoogleWebToolkit(GWT)
10.OpenXava
Java Web Development Frameworks
͞Full-stack" frameworks: SEAM, RIFE, Spring (?)
Address back-end soup-to-nuts web development
Typically include MVC component AND integration with enterprise systems
ADVANTAGES: complete stack, limited glue code
DISADVANTAGES: less plug-n-play; ͞heaǀyweight"
MVC frameworks:Struts, Spring MVC,etc.
Address ͞page flow" and reusability in web deǀelopment
Focused on simplifying MVC-based web application
Limited out-of-the-bodž integration with ͞enterprise" ADVANTAGES͗ pluggable architecture, ͞lightweight"
DISADVANTAGES: glue code
Choosing an MVC Framework
Two types of MVC frameworks:
Action-based (aka Push-based MVC)
Data is pushed from controller to view
Focused more on request flow
Struts, Spring MVC, Stripes
Component-based (aka Pull-based MVC)
Data is pulled in view
Focused more on view rendering
JSF, Wicket, Tapestry
Spring MVC & Struts
1)Struts is a web framework while spring is an application framework
in which spring MVC is one of the modules of spring framework.
2)Spring is a Layered Architecture while Struts is not.
3)Struts is heavy weight while Spring is light weight.
4)Struts supports tag Library while Spring does not.
5)Spring is loosely coupled while Struts is tightly coupled.
6)Spring provides easy integration with ORM technologies while in
struts, we need to do coding manually.
7)Struts easily integrate with other client side technologies. It is not
easy in case of spring.
Spring MVC Architecture
Front Controller design pattern
Thisdesignpattern
enforcesasingle pointofentryforall theincoming requests.Allthe requestsare handledbyasingle pieceofcodewhich canthenfurther delegatethe responsibilityof processingthe requesttofurther applicationobjects.
Spring MVC Architecture
MVC design pattern
Thisdesignpattern
helpsusdevelop looselycoupled applicationby segregatingvarious concernsinto differentlayers.
MVCdesignpattern
enforcesthe applicationtobe dividedintothree layers,Model,View andController.
Spring MVC Architecture
Spring's MVC module
Spring MVC Architecture
Spring's MVC module
Open Source Project Development Framework
OSPDF 7 Layers:
1.Controller
2.View (JSP pages)
3.DTO (Data Transfer Objects)
4.Service
5.Utilities
6.Entities
7.DAO (Data Access Object)
orproprietarything. (Document)
User Request(request URL)
Open Source Project Development Framework
Utility Class
for
Authentications
, validations, conversions etc.
HandlerMapping
PersonController
[stores form entries to DTO] through PersonService(DTO)
PersonService
[Converts DTO to Entity for
WRITE and Entity to DTO for
READ] calls PersonDAO(Entity)
PersonDAO
Calls GenericDAO for CRUD
operations using Hibernate.
Response back to User
DispatcherServlet
(Front Controller) IDE
ApplicationServer
platformtohandlemanyaspectsofprogramming automatically.
OSPDF using Spring MVC
Development Environment
For project development using Spring MVC the following things are required:
Database
DevelopmentFramework
EntityFramework
OSPDF using Spring MVC
Development Environment
Hibernate
1.Hibernate is database independent. You can work with any database you want like
oracle,mysql,db2,sql server ,etc. Using hibernate you won't worry about writing database specific queries and syntax. It's providesHQL(Hibernate Query Language), which is compatible with any database server. You just need to write queries in HQL, at the endhibernate converts
HQL to underlying database and executes it.
2. In ORM, you will map a database table with java object called "Entity". So once you map
these, you will get advantages of OOP conceptslike inheritance, encapsulation, etc.
3. Caching mechanism(1st level & 2nd level cache) provided hibernate means you don't need
to hit database for similar queries, you can cache it and use it from buffered memory to improve performance.
4.Supports Lazy loading(also called n+1 problem in Hibernate). Take an example-parent class
has n number of child class. So When you want information from only 1 child class,there is no meaning of loading n child classes.This is called lazy loading (Load only thing which you want). D I R E C T O R Y S T R U C T U R E
Spring MVC Login Page
Sample codes for development using Spring MVC
http://10.135.2.177:8080/loginIf you browse a URL
1. Layer-1: On seeing login, it will look for login controller (loginController.java)
@RequestMapping(value = "/login", method = RequestMethod.GET) public ModelAndView login(@ModelAttribute("log") LoginDTO dto, @RequestParam(value = "error", required = false) String error, @RequestParam(value = "logout", required = false) String logout) model.setViewName("login"); model.addObject("log", dto); return model;
2 Layer-2: Controller has set the view name and the DTO (login.jsp)
password: | |
Sample codes for development using Spring MVC
3. Layer-3: Now we see LoginDTO.java file
public class LoginDTO { public LoginDTO(){ private String loginname; private String username; public String getLoginname() { return loginname; public void setLoginname(String loginname) { this.loginname = loginname; 4. Layer-4 : Service implementation goes like this, (LoginSeviceImpl.java)
public class LoginServiceImpl implements LoginService { public String getLoginName(String username){ return loginDao.getLoginName(username); @Override public String getLoginPassword(String username){ return loginDao.getLoginName(username); Sample codes for development using Spring MVC
6. Layer-6: Login entity (LoginUser.java)
public class LoginUser implements UserDetails { private static final long serialVersionUID = 1L; private String username; private String password; @Override public String getUsername() { return username; 5. Layer-5 : Data access object (LoginDao.java)
public class LoginDaoImpl implements LoginDao { public String getLoginName(String username){ String encPass="";
Connection con=null;
7. Layer-7: General utilities (LoginUser.java)
public class ConvertDTO2Entity { public static User getEntity(PersonDTO dto){ User person=new User();
BeanUtils.copyProperties(dto, person);
AJAX (Asynchronous JavaScript And XML)
TheDocumentObjectModel(DOM)isa
cross-platformandlanguage-independent applicationprogramminginterfacethat treatsanHTML,XHTML,orXMLdocument asafreestructurewhereineachnodeisan objectrepresentingapartofthe document. MVC with AngularJS
forapplication. The following are some AngularJS directives which I have used in sample application. ng-app:It is entry point of AngularJS to the page. It shows that the application is AngularJS app. ng-controller:It is directive to define the controller. It attaches a controller class to the view. ng-repeat: It creates loop in your page like foreach loop. angular.module:It is use to create, register and retrieve all angular module. $http: It is an XMLHttpRequest object for requesting external data. $http.get: It read the json data. It takes two parameter url and config but config is optional. Example
(MVC 5 application development in DOTNET platform) MVC application development using Visual studio 2013 is so simple and configurable, this is shown in the example. MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
MVC 5 application development
The End
quotesdbs_dbs5.pdfusesText_9